tagged [timezone]

Convert UTC DateTime to another Time Zone

Convert UTC DateTime to another Time Zone I have a UTC DateTime value coming from a database record. I also have a user-specified time zone (an instance of TimeZoneInfo). How do I convert that UTC Dat...

30 Mar at 19:54

How to convert datetime to timestamp using C#/.NET (ignoring current timezone)

How to convert datetime to timestamp using C#/.NET (ignoring current timezone) How do I convert datetime to timestamp using C# .NET (ignoring the current timezone)? I am using the below code: But it r...

10 Nov at 11:21

How to set time zone of a java.util.Date?

How to set time zone of a java.util.Date? I have parsed a `java.util.Date` from a `String` but it is setting the local time zone as the time zone of the `date` object. The time zone is not specified i...

30 Jun at 17:1

How to convert Long type datetime to DateTime with correct time zone

How to convert Long type datetime to DateTime with correct time zone For example `1297380023295` should be 2010/2/11 9 AM I use this code right now The result of this function

11 Feb at 01:16

Set System Time Zone from .NET

Set System Time Zone from .NET Does anyone have some code that will take a TimeZoneInfo field from .NET and execute the interop code to set the system time zone via SetTimeZoneInformation? I realize t...

30 Apr at 19:54

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

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)...

How do I get the current time zone of MySQL?

How do I get the current time zone of MySQL? Anyone knows if there is such a function in MySQL? This doesn't output any valid info: ``` mysql> SELECT @@global.time_zone, @@session.time_zone; +--------...

3 Sep at 17:39

Getting system Timezones in different languages

Getting system Timezones in different languages I'm currently getting the list of all timezones like this: So for instance, the timezone in Paris has a `DisplayName` property of `W. Europe Standard Ti...

4 Nov at 20:58

Get timezone from DateTime

Get timezone from DateTime Does the .Net DateTime contain information about time zone where it was created? I have a library parsing DateTime from a format that has "+zz" at the end, and while it pars...

23 Feb at 06:53

Get TimeZone offset value from TimeZone without TimeZone name

Get TimeZone offset value from TimeZone without TimeZone name I need to save the phone's timezone in the format [+/-]hh:mm I am using TimeZone class to deal with this, but the only format I can get is...

26 Jun at 14:17

Get the default timezone for a country (via CultureInfo)

Get the default timezone for a country (via CultureInfo) Is there a program or a table that provides the default timezone for every country? Yes, the US, Canada, & Russia have multiple timezones. (I t...

30 Oct at 23:0

Java SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") gives timezone as IST

Java SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") gives timezone as IST I have SimpleDateFormat constructor as and I am parsing string `"2013-09-29T18:46:19Z".` I have read that here Z represents the ...

.NET TimeZoneInfo from Olson time zone

.NET TimeZoneInfo from Olson time zone How can I convert the following into a System.TimeZone or System.TimeZoneInfo? This is data I'm getting back from a 3rd party web service. I'm assuming the offse...

26 May at 19:43

What is the best way to get a formatted string to represent UTC offset?

What is the best way to get a formatted string to represent UTC offset? I need to format a date like so: 20110202192008-0500. The following code does the trick but I was wondering if there is a better...

2 Feb at 20:5

Convert datetime without timezone

Convert datetime without timezone I have date in string: "2013-07-22T08:51:38.000-07:00" When I [try parse](http://msdn.microsoft.com/en-us/library/ch92fbc1.aspx) this string, I receive date with offs...

11 Dec at 03:45

What is the difference between UTC and GMT?

What is the difference between UTC and GMT? I have a few queries regarding the Time zones: 1. Can the time be captured in UTC alone? 2. Is UTC -6 and GMT -6 the same, and does that mean it is US local...

30 Oct at 09:12

How to get the client timezone id for c# timezoneinfo class from client side using javascript

How to get the client timezone id for c# timezoneinfo class from client side using javascript I want to get client timezone id from JavaScript to parse c# TimezoneInfo class.And Convert to utc time.An...

set global timezone in .net core

set global timezone in .net core In .Net Core 2 - Is there a way to set the application's timezone globally so that whenever I request for `DateTime.Now` I'll get the current time for a timezone I wan...

Format String to Datetime with Timezone

Format String to Datetime with Timezone I have a `string s = "May 16, 2010 7:20:12 AM CDT` that i want to convert into a DateTime object. In the code below i get a Date format cannot be converted erro...

9 Aug at 01:32

TimeZoneInfo from timezone minutes offset

TimeZoneInfo from timezone minutes offset From JavaScript I have passed, to the controller, the number of minutes that the user's client date time is offset from UTC using the method `getTimezoneOffse...

TimeZoneInfo in .NET Core when hosting on unix (nginx)

TimeZoneInfo in .NET Core when hosting on unix (nginx) For example, when I try to do the following. I get the error, that the `TimeZone` is not available on the local computer. When I run this locally...

10 Jan at 10:21

How to set a time zone (or a Kind) of a DateTime value?

How to set a time zone (or a Kind) of a DateTime value? I mean to store strict UTC time in a DateTime variable and output it in ISO 8601 format. To do the last I've used `.ToString("yyyy-MM-ddTHH:mm:s...

27 Jan at 07:59

DateTime vs DateTimeOffset

DateTime vs DateTimeOffset What is the difference between a `DateTime` and a `DateTimeOffset` and when should one be used? --- Currently, we have a standard way of dealing with .NET `DateTime`s in a T...

How to convert time between timezones (UTC to EDT)?

How to convert time between timezones (UTC to EDT)? I need to have a common function to convert UTC time to EDT. I have a server in India. An application in it needs to use EDT time for all time purpo...

8 Jun at 13:25

DateTime parsing error: The supplied DateTime represents an invalid time

DateTime parsing error: The supplied DateTime represents an invalid time I have one situation where date is `"3/13/2016 2:41:00 AM"`. When I convert date by time-zone, I get an error. ``` DateTime dt ...

5 Apr at 10:8