The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Formatting Date Variable (Pls help) gmoth Shell Programming and Scripting 1 02-19-2008 08:03 AM
Date formatting knc9233 UNIX for Dummies Questions & Answers 8 01-16-2007 02:17 PM
date formatting mgirinath Shell Programming and Scripting 4 07-08-2006 02:08 AM
Formatting Date (adding a month) devid UNIX for Dummies Questions & Answers 4 01-18-2006 06:31 AM
Formatting date radhika03 Shell Programming and Scripting 2 12-13-2005 10:56 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-22-2007
Registered User
 

Join Date: Aug 2007
Posts: 3
Stumble this Post!
Question formatting date for different locales

Hi,

I need to know
1.the usage of LC_TIME with setlocale().
2.the usage of getdate() utility

I read that date formatting for different languages needs
1.user-supplied template file and
2.DATEMSK environment variable set to path of the template fie.

Can anyone pls tell me how to do this ?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-22-2007
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,841
Stumble this Post!
First off, the format strings are the same regardless of NLS (locale) settings.
ie. %Y is a four digit number %A = day of week. This works unless you are using wide characters- ie, a charset like Greek or Arabic. Then you use alternates. These begin with %E or %O.

Next.
What locale for LC_TIME? And to answer that we need to know which UNIX you're using.
Plus, you do know LC_TIME can affect things like the first day of the week as well.

Do you know about setlocale()?

Finally.
Read the man page about strptime(). It is far easier to use than getdate(), because it does not require an external file.

If you give us exact specifications it would help a lot.
Reply With Quote
  #3 (permalink)  
Old 08-22-2007
Registered User
 

Join Date: Aug 2007
Posts: 3
Stumble this Post!
Question date conversions at runtime

Quote:
Originally Posted by jim mcnamara View Post
What locale for LC_TIME? And to answer that we need to know which UNIX you're using.
Plus, you do know LC_TIME can affect things like the first day of the week as well.

Do you know about setlocale()?

If you give us exact specifications it would help a lot.
I need to do date conversions between german and french at runtime.

mine is red hat linux 9
am a beginner & I ve a little knowledge about setlocale and LC_TIME.
I tried a sample helloworld L10N program through gettext utility.

Thanks for the quick reply jim,

Aeon.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:38 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0