Questions tagged [datetimeoffset]

DateTimeOffset is a data structure that encapsulates a DateTime value and the Offset from UTC that the value reflects. It is used to represent an instantaneous moment in time, while still capturing the perspective of the observer.

DateTimeOffset is a data structure that encapsulates a DateTime value and the Offset from UTC that the value reflects. It is used to represent an instantaneous moment in time, while still capturing the perspective of the observer.

Contrary to popular belief (and to much of the documentation) the offset provided does not represent a time zone. One might start with a time zone to obtain the offset, but it is a one-way function. You can not determine the time zone by the offset alone. For a better understanding of this, see this community wiki answer.

The preferred serialization format for this type of data is defined as part of the ISO-8601 specification.

  • Example: 1997-07-16T19:20:30+01:00

DateTimeOffset and similar structures are presented in:

Please update this list if you are aware of similar structures in other languages, frameworks, or databases

527 questions
-3
votes
1 answer

In Go, given a location name, how can we determine the current time in that location?

We can't use the offset returned by Zone(): package main import "fmt" import "time" func main() { loc, _ := time.LoadLocation("America/Los_Angeles") t := time.Date(2015,04,12,19,23,0,0,loc) t2 := time.Date(2015,03,1,19,23,0,0,loc) …
miguelv
  • 2,856
  • 1
  • 23
  • 22
-4
votes
1 answer

How convert PST Unix timestamp to UTC?

How convert PST Unix timestamp to UTC and then to any custom time zone (GMT+2, ...) ? Please provide solution in javascript or nodejs lib (momentjs)
Oleg Dats
  • 3,307
  • 8
  • 32
  • 61
1 2 3
35
36