I need to force any time related operations to GMT/UTC, regardless the timezone set on the machine. Any convenient way to so in code?  To clarify, I'm using the DB server time for all operations, but it comes out formatted according to local timezone.  Thanks!
25101
When I create a new Date object, it is initialized to the current time but in the local timezone. How can I get the current date and time in GMT?
1793
Is there a standard way for a web server to be able to determine a user's timezone within a web page?   Perhaps from an HTTP header or part of the user-agent string?
101488
Alright, quick question.  A server is running in Eastern Time. PHP program needs to make date calculations using Central time.  At the moment, I am putting this line at the very top of my script:  putenv("TZ=US/Central");   Is that the best way to go about that or is there some PHP trick I'm not aware of?  Cheers.
30685
I have a Timestamp value that comes from my application. The user can be in any given local TimeZone.  Since this date is used for a WebService that assumes the time given is always in GMT, I have a need to convert the user's parameter from say (EST) to (GMT). Here's the kicker: The user is oblivious to his TZ. He enters the creation date that he wants to send to the WS, so what I need is:  User enters: 5/1/2008 6:12 PM (EST)  The parameter to the WS needs to be: 5/1/2008 6:12 PM (GMT)  I know TimeStamps are always supposed to be in GMT by default, but when sending the parameter, even though I created my Calendar from the TS (which is supposed to be in GMT), the hours are always off unless the user is in GMT. What am I missing?  Timestamp issuedDate = (Timestamp) getACPValue(inputs_, "issuedDate"); Calendar issueDate = convertTimestampToJavaCalendar(issuedDate); ... private static java.util.Calendar convertTimestampToJavaCalendar(Timestamp ts_) {   java.util.Calendar cal = java.util.Calendar.getInstance(       GMT_TIMEZONE, EN_US_LOCALE);   cal.setTimeInMillis(ts_.getTime());   return cal; }   With the previous Code, this is what I get as a result (Short Format for easy reading):  [May 1, 2008 11:12 PM]
87397
My current time in Windows7 is set to UTC +8 (Kuala Lumper). For some reason, the time is always 8 hours ahead. Curiously though, my applications seem to be using the 'right time' that is it is not 8 hours ahead. For example, the local time now is 12pm, windows time is reporting 8pm. If I send an email to myself via outlook, the time shown is 12pm. So only the windows time is off kilter.  I can fix this by syncing the time with the Internet Time Servers but it jumps back to the wrong time every few hours.  I have been having this problem since I dual booted my win7 with linux ubuntu if it helps.
21012
[Running Ubuntu Gnome 15.10]  I recently brought my computer from PST to EST in North America.  Once in EST my laptop did not update the timezone.  I tried toggling the "Auto Time Zone" switch which had no effect.  Finally, I rebooted the machine which also didn't have an effect.  Running /usr/lib/geoclue-2.0/demos/where-am-i doesn't return any result.
51460
I've used the  function in Perl to get the current date and time but need to parse in existing dates. I have a GMT date in the following format: "20090103 12:00" I'd like to parse it into a date object I can work with and then convert the GMT time/date into my current time zone which is currently Eastern Standard Time. So I'd like to convert "20090103 12:00" to "20090103 7:00" any info on how to do this would be greatly appreciated.
65271
I want to check the time      Eastern Daylight Time   Time zone in Washington, DC, USA (GMT-4)   Thursday, May 9, 2019, 8:11 PM   However,   $ TZ="EDT" date Fri May 10 00:12:25 EDT 2019   "EST" works properly  $ TZ="EST" date Thu May  9 19:13:11 EST 2019   What's the problem?
68699
Following on from my previous question, , I have now come across a problem regarding the timezone, and it turns out that it's not always going to be "+0200". So when strptime tries to parse it as such, it throws up an exception.  I thought about just chopping off the +0200 with [:-6] or whatever, but is there a real way to do this with strptime?  I am using Python 2.5.2 if it matters.  &gt;&gt;&gt; from datetime import datetime &gt;&gt;&gt; fmt = "%a, %d %b %Y %H:%M:%S +0200" &gt;&gt;&gt; datetime.strptime("Tue, 22 Jul 2008 08:17:41 +0200", fmt) datetime.datetime(2008, 7, 22, 8, 17, 41) &gt;&gt;&gt; datetime.strptime("Tue, 22 Jul 2008 08:17:41 +0300", fmt) Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt;   File "/usr/lib/python2.5/_strptime.py", line 330, in strptime     (data_string, format)) ValueError: time data did not match format:  data=Tue, 22 Jul 2008 08:17:41 +0300  fmt=%a, %d %b %Y %H:%M:%S +0200
4975
I have a file that was modified either before or after it was sent to me. However, it was created in a different time zone, so if the modification date is in the timezone of the sender, he was the last to modify it. If it is in my timezone, I modified it.  So, do you know if Windows file modification dates are timezone aware?
5043
I currently use the following to get a local datetime from a UTC datetime:  SET @offset = DateDiff(minute, GetUTCDate(), GetDate()) SET @localDateTime = DateAdd(minute, @offset, @utcDateTime)   My problem is that if daylight savings time occurs between GetUTCDate() and @utcDateTime, the @localDateTime ends up being an hour off.  Is there an easy way to convert from utc to local time for a date that is not the current date?  I'm using SQL Server 2005
73645
I wrote a little bash script that made me stumble across the . I did not know about this problem before and I just dare on posting the --debug output I got from date when my script tried to calculate across this magic date (03:14:07 UTC on 19 January 2038).  date -d "20380119"  date: parsed number part: today/this/now date: input timezone: +01:00 (set from system default) date: warning: using midnight as starting time: 00:00:00 date: starting date/time: '(Y-M-D) 2038-01-19 00:00:00 TZ=+01:00' date: '(Y-M-D) 2038-01-19 00:00:00 TZ=+01:00' = 2147468400 epoch-seconds date: output timezone: +01:00 (set from system default) date: final: 2147468400.000000000 (epoch-seconds) date: final: (Y-M-D) 2038-01-18 23:00:00 (UTC0) date: final: (Y-M-D) 2038-01-19 00:00:00 (output timezone TZ=+01:00) Tue Jan 19 00:00:00 CET 2038   date -d "20380119 + 1 days"  date: parsed hybrid part: +1 day(s) date: input timezone: +01:00 (set from system default) date: warning: using midnight as starting time: 00:00:00 date: starting date/time: '(Y-M-D) 2038-01-19 00:00:00 TZ=+01:00' date: warning: when adding relative days, it is recommended to specify 12:00pm date: error: adding relative date resulted in an invalid date: '(Y-M-D) 2038-01-20 00:00:00 TZ=+01:00' date: invalid date '20380119 + 1 days'   date -d "20380120" --debug  date: parsed number part: today/this/now date: input timezone: +01:00 (set from system default) date: warning: using midnight as starting time: 00:00:00 date: error: invalid date/time value: date:     user provided time: '(Y-M-D) 2038-01-20 00:00:00 TZ=+01:00' date:        normalized time: '(Y-M-D) 2038-01-20 00:00:00 TZ=+01:00' date:  date:      possible reasons: date:        numeric values overflow; date:        missing timezone date: invalid date '20380120'   Is there any way to make GNU date calculate across this date? (on a LINUX 32 bit system)    Operating System: Debian GNU/Linux buster/sid             Kernel: Linux 4.12.0-2-686-pae       Architecture: x86
120132
If the system time is changed on Linux, what files get edited? I know the timezone is kept in etc/timezone but is there anything if the timezone is not changed, but the time is?
56522
Ever since I started using Linux in dualboot with Windows I noticed that when I rebooted the machine, the time on the other OS was wrong, e.g. it was 12:00 on Linux, then I rebooted and on Windows it was 18:00, and when I checked the BIOS, the RTC was set to 18:00. Since my timezone is -06:00 CST I assume Linux just sets the RTC’s time to UTC and re-calculates the time based on the timezone, whereas Windows just sets the RTC to the local time. Both use the same NTP server to sync the time.  The question is, which one is doing the right thing? On which one should I set the timezone setting to UTC in order to have the right time on both?
11596
I often move between 2 time zones, and expect my Windows 7 laptop to somehow automatically change the system time, being spoiled by the same feature on my cell phone. I always assumed that desktop O/Ses simply did not do this, but I was shocked yesterday when I noticed that OSX on the MacBook actually does this!  Does anybody know of any utilities that does this on Windows, specifically Windows 7? There has to be something out there?
18594
What is the module/method used to get the current time?
87937
Is it possible to configure Windows 7 to use YYYY-MM-DD instead of DD/MM/YYYY as the date format? How? Where?