Questions tagged [timezone-offset]

A time zone offset describes the difference between a "wall time" and UTC. General questions about time zones will get better visibility when tagged with 'timezone'.

A time zone offset describes the difference between a "wall time" and UTC.

Time zones can change their offsets for many reasons, including daylight saving time. Therefore, an offset is not the same thing as a time zone, and It is only valid for the specific instant it is associated with.

General questions about time zones will get better visibility when tagged with .

See also the timezone tag wiki.

1036 questions
29
votes
4 answers

Getting the correct timezone offset in Python using local timezone

Ok let me first start by saying my timezone is CET/CEST. The exact moment it changes from CEST to CET (back from DST, which is GMT+2, to normal, which GMT+1, thus) is always the last Sunday of October at 3AM. In 2010 this was 31 October 3AM. Now…
Joren Van Severen
  • 2,269
  • 2
  • 24
  • 30
28
votes
3 answers

timezone aware date_trunc function

The following query SELECT the_date FROM date_trunc('day', timestamp with time zone '2001-01-1 00:00:00+0100') as the_date results to the_date 2000-12-31 00:00 Is there a way to tell date_trunc to do day/month/year conversions based on the…
Jay
  • 2,519
  • 5
  • 25
  • 42
27
votes
4 answers

Get timezone offset from timezone name using Javascript

I found many solution that gives Timezone name from offset value. But I have Timezone name and I want offset value for that. I tried setTimezone('Asia/Kolkata'), but I think their is no method like setTimezone. example: Asia/Kolkata should give me…
Hardik Sondagar
  • 4,347
  • 3
  • 28
  • 48
27
votes
2 answers

timezone with DST handling by PHP

I am working on a calendar application. In this users from different time-zones create/view events. I am thinking to follow below method to save event time in UTC and display them in user's local time. Note: user has their preferred timezone…
Krishna Shetty
  • 1,361
  • 4
  • 18
  • 39
26
votes
4 answers

Which time zone does JavaScript `new Date()` use?

I have a C# application that return in JSON an expiration date of an authentication token like this: "expirationDate":"Fri, 27 Mar 2015 09:12:45 GMT" In my TypeScript I check that the date is still valid here: isAuthenticationExpired =…
Alan2
  • 23,493
  • 79
  • 256
  • 450
26
votes
2 answers

Converting between time zones with Noda Time

I'm currently trying to ensure that our legacy back-end can support resolving date times based on the user's current time zone (or, more specifically offset). Our servers are in eastern standard time, and most of our date times originate there. …
PureCognition
  • 1,253
  • 2
  • 10
  • 14
25
votes
1 answer

Google Apps Script formatDate using user's time zone instead of GMT

In a function within Google Apps Script I am using Utilities.formatDate() let formattedTimestamp = Utilities.formatDate(new Date(), "GMT", "hh:mm a"); The resulting string is a timestamp in the GMT time zone but I need it to be in the current…
Employee
  • 2,231
  • 3
  • 33
  • 60
24
votes
1 answer

Why So Many IANA Time Zones Names?

Javascript allows you to see what time it is in another timezone if you specify the IANA given name of that timezone. For example: let strTime = new Date().toLocaleString("en-US", {timeZone: "America/Chicago"}); console.log(strTime); Below you…
Lonnie Best
  • 9,936
  • 10
  • 57
  • 97
24
votes
1 answer

What is the best way to store timezone information in my DB?

I have a asp.net-mvc web site that i took over and there is a page page where people enter information and times (including local timezone). The database is persisting a start time, an end time and a timezone as it feels a bit flaky to me. here is…
leora
  • 188,729
  • 360
  • 878
  • 1,366
22
votes
8 answers

Convert UTC offset to timezone or date

A head scratcher for you. I am grabbing geo IP data from IPInfoDB's API and it returns a timezone offset from UTC including DST (if currently reflected). For example, I live in EST (-5) and currently it's DST, so the geo IP API returns (-04:00) as…
Kyle Ross
  • 2,090
  • 4
  • 20
  • 27
21
votes
1 answer

Trying to understand “PT1H” in a date-time string

I'm using the Weather API to pull weather information down as a service for my project. I'm trying to understand some timezone offsets that I can't seem to find information on. The URL I'm using…
adviner
  • 3,295
  • 10
  • 35
  • 64
19
votes
5 answers

Get system local timezone in python

Seems strange, but I cannot find an easy way to find the local timezone using pandas/pytz in Python. I can do: >>> pd.Timestamp('now', tz='utc').isoformat() Out[47]: '2016-01-28T09:36:35.604000+00:00' >>> pd.Timestamp('now').isoformat() Out[48]:…
ntg
  • 12,950
  • 7
  • 74
  • 95
18
votes
5 answers

How to retrieve timezone offset from GMT+0 in php?

I am no expert in php. I know timezones are supported in PHP. For a given timezone TZ supported by PHP, I need to retrieve the offset (i.e., number of hours and minutes to add or substract) to a known UTC (i.e. GMT+0) to get that time in the TZ…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
18
votes
3 answers

AngularJS global Date timezone offset

I'm looking to show dates relative to the users' timezones. My hope is that Angular has way to globally config the Date filter to do this—having to do this manually on a case-by-case basis feels wrong. My timestamps are already wrapped in a…
couzzi
  • 6,316
  • 3
  • 24
  • 40
16
votes
1 answer

Historic timezone offsets in newer JDK versions

I found a weird java discrepancy while testing some timezones with the use of ZonedDateTime. I was trying to parse a date before 1970 and saw that the result changes between java versions. The offset for Netherlands in 1932 is +00:19. Does anyone…
1
2
3
68 69