- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problems of Different Time Zones on Applications
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2008 10:56 PM
тАО06-24-2008 10:56 PM
we would like to refer to your practice of different time zones on applications.
Please kindly tell us how you resolved the following issues.
For example, if the server time zone corresponds to New York (GMT-5) and the client time zone corresponds to
San Francisco (GMT-8), the client finished a transaction on the data center web system at local time (12-Jun-2008 15:30:45)
then what value stored in the database?
1. server time as тАЬ12-Jun-2008 18:30:45тАЭ
2. client time with time zone as тАЬ12-Jun-2008 15:30:45 GMT-5тАЭ
3. others?
And what time will be displayed to the user?
1. server time as тАЬ12-Jun-2008 18:30:45тАЭ
2. server time with time zone as тАЬ12-Jun-2008 18:30:45 GMT-5тАЭ
3. client time as тАЬ12-Jun-2008 15:30:45тАЭ
4. client time with time zone as тАЬ12-Jun-2008 15:30:45 GMT-8тАЭ
5. others?
Thanks for your help.
Solved! Go to Solution.
- Tags:
- TZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2008 11:16 PM
тАО06-24-2008 11:16 PM
SolutionThere is only one time, UTC or time_t.
Local times should be converted to UTC and then stored in the database. If you want to display the time, use ctime(3) and each locale would export different values of TZ.
>what value stored in the database?
>3. others?
Yes, UTC. 12-Jun-2008 22:30:45
>And what time will be displayed to the user?
>4. client time with time zone as "12-Jun-2008 15:30:45 GMT-8"
Yes since users are chauvinistic but with a zone, PDT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2008 11:37 PM
тАО06-24-2008 11:37 PM
Re: Problems of Different Time Zones on Applications
In such circumstances we use Greenwich Mean time.
Understand that time in Unix is really the number of seconds since Jan 1, 1970.
Time zone is merely a display format that will not bother most normally written applications.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2008 06:30 PM
тАО06-25-2008 06:30 PM
Re: Problems of Different Time Zones on Applications
Is there any other exception?
Thanks
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2008 06:38 PM
тАО06-25-2008 06:38 PM
Re: Problems of Different Time Zones on Applications
>what value stored in the database?
>3. others?
Yes, UTC. 12-Jun-2008 22:30:45
--> It should be 12-Jun-2008 23:30:45 GMT ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2008 08:27 PM
тАО06-25-2008 08:27 PM
Re: Problems of Different Time Zones on Applications
>It should be 12-Jun-2008 23:30:45 GMT?
Are you commenting about the missing "GMT"?
No, UTC is the official term.
$ date -u
Thu Jun 26 04:13:51 UTC 2008
If you are pointing out 22:30 vs 23:30, then I think I'm right. The local time here in the San Jose Bay Area is now:
$ date; date -u
Wed Jun 25 21:18:17 PDT 2008
Thu Jun 26 04:18:17 UTC 2008
Since it is PDT, UTC is only 7 hours more advanced.
>4. client time with time zone as 12-Jun-2008 15:30:45 GMT-8
This seems like that bogus Microsoft way of doing things. I.e. the timezone is normally UTC-8. But during DST, it is -7.
This is expressed on UNIX as PST8PDT. And times are printed as PST or PDT.
(Note San Francisco is that small town north of San Jose. ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2008 10:14 PM
тАО06-25-2008 10:14 PM
Re: Problems of Different Time Zones on Applications
Thanks a lot. Does your application provide a profile which every user can config his/her local time zone?
BTW, may I contact you via email?
If convenient, pls mail to ericfjchen@gmail.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2008 10:58 PM
тАО06-25-2008 10:58 PM
Re: Problems of Different Time Zones on Applications
In HP-UX, the system startup and login scripts initialize the TZ variable to a value specified in /etc/TIMEZONE. But this is just the system default (i.e. what the system services like cron and sendmail use in their logging).
Any user can modify the TZ environment variable for his/her session if necessary. The user can even run several programs using different timezones.
If you're using an X Window System, try these commands:
TZ=PST8PDT xclock &
TZ=EST5EDT xclock &
TZ=UTC0 xclock &
You now should have three xclocks telling you the time in three different timezones - with no options specified to the xclock command. Only the TZ environment variable was changed.
You can do this to any program which cares about time.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2008 11:15 PM
тАО06-25-2008 11:15 PM
Re: Problems of Different Time Zones on Applications
Well, I just use the standard UNIX TZ variable as MK explained.
(I don't have a specific application, nor do I use a database. But the compiler does store date info in object files.)
>may I contact you via email?
Unless you have something private, why not continue here.