FAQ Database Discussion Community


BST date string to javascript date

javascript,date,timezone
How can I convert the BST date string to Javascript date object? The follwing code gives me error for BST but works for other timezone var data='Tue Apr 28 16:15:22 BST 2015'; var date = new Date(data); console.log(date) Output Invalid Date var data='Tue Apr 28 16:15:22 BST 2015'; var date...

.ToUniversalTime() Is Incorrect?

c#,datetime,timezone
DateTime dt = new DateTime(1972, 4, 24, 0, 0, 0); Response.Write("dt: " + dt.ToString("M/d/yyyy h:mm:ss tt") + "<br />"); Response.Write("dt.Kind: " + dt.Kind.ToString() + "<br />"); Response.Write("dt.ToUniversalTime(): " + dt.ToUniversalTime().ToString("M/d/yyyy h:mm:ss tt") + "<br />"); displays dt: 4/24/1972 12:00:00 AM dt.Kind: Unspecified dt.ToUniversalTime(): 4/24/1972 7:00:00 AM which is incorrect....

How to make event trigger at the same time on all devices regardless of timezone

java,android,calendar,timezone
If my application triggers an event at 9pm EST, It should also trigger this event at 6pm PST. Currently I am parsing a feed and this feed says that the event will run at 9 pm EST. Without altering the feed, what is the best way to make my code...

DateTime Time Zone conversion bug

c#,datetime,timezone,datetime-conversion
I try to convert my local time (Kiyv, Riga, UTC+02:00) to UTC, but there is an error in the following method TimeZoneInfo.ConvertTimeToUtc(clientDate, TimeZoneInfo.FindSystemTimeZoneById(tTimeZone.SystemId)); clientDate is 19.06.2015 16:35:00 tTimeZone.SystemId is FLE Standard Time The result is 19.06.2015 13:35:00, but as I know the result should be 19.06.2015 14:35:00 Why does this...

Time Conversion with TimeZoneInfo for past years

c#,timezone,registry
Does the TimeZoneInfo.ConvertTimeFromUtc method read the daylight saving settings from the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zone to calculate the local time? If so, does it work for only the current time and not for any past years or dates? I would like to know if I can convert a past date...

looking up time zone standard name by abbreviation in .Net

c#,datetime,timezone
Given a string of "EST", is there a way in .net (c#) to look up the standard name string like "Eastern Standard Time" in return? I know that TimeZoneInfo object has the StandardName field, but I cannot associate it with just the abbreviation. I would hope to strictly do the...

Convert timezone using php?

php,date,timezone
How do I convert the timestamp 2015-06-05 14:05:01 to another timezone using php? I've read and tried numerous ways listed on here but I cannot get the desired result. Using date_format($date,"M d h:i A") and date_default_timezone_set('America/New_York') I get June 05 2:05 PM which is the original origin of the server...

UTC Time different on servers in different timezones?

c#,sql-server,asp.net-mvc,datetime,timezone
On my dev server I save a value called "ScheduledDateUtc" date to sqlserver e.g. 24-11-14 09:00:00. I also save a value called "UtcOffset" and calculate the "ScheduledDateLocal" like so: var ScheduledDateLocal = ScheduledDateUtc.AddHours(UtcOffset); //a negative offset would be deducted and a positive offset would be added On my dev server...

How to use Standard Time Only in TimezoneInfo.ConvertTime C#

c#,timezone,dst,datetime-conversion
I am having a Issue with the C# function of TimeZoneInfo.ConvertTime(). What i need to get is the Standard Time not the DST but i'm only getting DST is there a way to Tell the Function to only get the Result in Standard Time. My local Timezone is UTC -6:00...

iOS: Timezone issue occurring

ios,objective-c,iphone,timezone,nstimezone
Seems that apple timezone is having problems for me right now. I tested the following code below and it isn't working correctly. This is what I have so far. NSDate *today = [NSDate date]; NSDateFormatter *estDf = [[NSDateFormatter alloc] init]; [estDf setTimeZone:[NSTimeZone timeZoneWithName:@"EST"]]; [estDf setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSString *stringDate = [estDf...

boost local_date_time CET to UTC

c++,boost,timezone
I try to convert a boost local_date_time to UTC but I'm confused about the returned time of utc_time(). Here is a simplified code : #include "boost/date_time/local_time/local_time.hpp" int main() { using namespace boost::gregorian; using namespace boost::local_time; using namespace boost::posix_time; ptime dt = ptime(date(2015, Mar, 2), hours(0)); time_zone_ptr tz_cet(new boost::local_time::posix_time_zone("CET")); local_date_time local_dt...

Create a local date from a UTC date string in Moment.js

javascript,date,timezone,momentjs,utc
Given a UTC date string (formatted: YYYYMMDDHHmmss) I'd like to create a date with the local timezone using Moment.js. I have tried the following: var utcDateStr = '20140101120000'; var localDate = moment.utc(utcDateStr, 'YYYYMMDDHHmmss'); //actual: true //desired: false console.log(localDate._isUTC) //actual: "Wed Jan 01 2014 12:00:00 GMT+0000" //desired: "Wed Jan 01 2014...

Actionscript 3 : get time to specific timezone (not the computer one)

actionscript-3,flash,date,timezone
I have an UTC timestamp and I would like to display the corresponding date and hour in a specific timezone (e.g. France local time) which is not the local timezone of the computer which might be in US. It seems complicated to take into account Daylight saving time. On Flash/as3...

Getting Current Date and Time of a Specific Country

c#,asp.net,datetime,timezone
i need to get Turkey's (Istanbul) date and time from a server in another country. So i can use it in my asp.net project and add it to my sql server database. Can you help me please ?

Python difference between timezones

python,datetime,timezone,python-3.2
I have to create a code that can tell me the current time in any city (as a variable) and print the utc offset between that time and utc. I already have the following code which gives the current time and the offset from a timezone, but this timezone is...

Are TimeZoneInfo.Id indexes are always the same?

.net,windows,timezone
I listed all the timezone IDs by using the TimeZoneInfo.Id .net property and I see that these IDs are language specific This means I can't find the one I am looking for by it's name on operating systems using different languages. Its very tempting to simply pick the one I...

using timezones like EST, CET, PST in php

php,timezone
I want to use timezones which are under the Others section in php like EST, PST, CET but there is a warning telling not to.. so what's the alternative if I do need them? Is it safe to use them despite the warning?

Ruby: Time.parse() Incorrectly Returning Alaskan Timezone

ruby,datetime,timezone
In my app, I am using > Time.parse('12:30 pm MDT').utc => 2015-06-08 18:30:00 UTC > Time.parse('12:30 pm EDT').utc => 2015-06-08 16:30:00 UTC > Time.parse('12:30 pm CDT').utc => 2015-06-08 17:30:00 UTC > Time.parse('12:30 pm PDT').utc => 2015-06-08 19:30:00 UTC > Time.parse('12:30 pm MST').utc => 2015-06-08 19:30:00 UTC Which all works just...

Java - current time in different time-zones

java,time,calendar,timezone,utc
I want to create a thread, that will write current time in difference zones every second. This is what I came up with: class TimeThread extends Thread { String city; String belt; public TimeThread(String city, String belt) { this.city = city; this.belt = belt; } @Override public void run() {...

set timezone for tomcat

timezone,tomcat7,openshift
I've got issue with this file .openshift/action_hooks/pre_start, the text is export JAVA_OPTS_EXT="-Duser.timezone=Europe/Stockholm" but new timezone does't work. It's not changing. Any help, with this? Thanks...

Why compareDate from NSCalendar seems to need to set an UTC timeZone to work properly?

ios,timezone,nsdate,nscalendar
I create two dates like the following: let date1 = stringToDate("2015-02-12 12:29:29")! let date2 = stringToDate("2015-02-11 19:18:49")! func stringToDate(var dateString: String) -> NSDate? { let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" dateFormatter.timeZone = NSTimeZone(name: "UTC") return dateFormatter.dateFromString(dateString) } As you can see, the two date are different and are...

Working with DateTime Time Zones

c#,datetime,timezone,utc,localtime
I am writing some code where I have a DateTime in UTC and I need to display this as a LocalTime where I have a Culture object for two timezones. Here is my code: public void CultureDateTimeLocalTime() { DateTime dateTimeUtcNow = DateTime.UtcNow; DateTime convertedDate = DateTime.SpecifyKind(dateTimeUtcNow, DateTimeKind.Utc); DateTime dateTimeLocalTime =...

Do filesystems store time zone information?

python,timezone
Do filesystems store time zone information along with the file information? I ran into a weird bug where I do the following snippet and I get different time zone printed out. import DateTime #zope's module for each in os.listdir("director"): print DateTime.DateTime(os.stat(each)[8]) #Why is it mixed up? Foo 12:00:00 US/Eastern Bar...

iOS: What should I use EST or EDT and why?

ios,objective-c,timezone
I asked a question not too long ago about timezone and I was using EST. Users suggested me to use EDT. I want to know why I should use one or the other because they both print the same time for me. Here is the code to better illustrate what...

How can we convert a time from EDT to EST in rails?

ruby-on-rails,timezone,activesupport
I know the difference between EDT and EST is just in the Day Light Saving of 1 hour, but still I assume Rails treats it as different time zones, right? Now, I have two time values, one in EDT zone and the other in IST. I need to convert both...

How to add capital to django-cities-light country model?

python,django,timezone,countries,django-countries
I'm using django-cities-light (lighter version of django-cities) with Django 1.8.x. It defines the abstract models of Country, Region/State and City, so that we can extend and add custom fields. For example, we can add timezone to city by writing a post_import signal handler as explained here. Likewise I need to...

PHP strtotime timezone issue with '0:00 GMT'

php,timezone,strtotime
So I have a function get_start_of_day($time), which I want to give me a timestamp representing the very very first minute of the day in which $time, a timestamp, falls. Originally, I was using: function get_start_of_day($time) { return strtotime('0:00 GMT', $time); } which seemed to be working just fine. Then I...

Moment Timezone : I don't understand how default timezones work

javascript,timezone,momentjs
Say it's 10:00am in my local time, America/Denver. When I set the default timezone in moment timezone: moment.tz.setDefault("America/Chicago"); Current time objects are printed out in the correct timezone, America Chicago: moment().toString(); // returns 11:00am However, when I parse in a date, for example: // exampleTime equal to 9:05am, already in...

DateTime.Ticks property value

c#,datetime,timezone
Shouldn't the value of DateTime.Now.Ticks be the same as DateTime.UtcNow.Ticks? I checked their values and found that the difference represents my current time zone offset from UTC. What am I missing here?

Subtract hours from the now() function

sql,postgresql,datetime,timezone,date-arithmetic
We have a machine running 24x7. Every day I report the number of pieces it produced per hour. In our case one working day means '2015-06-16 06:00:00' to '2015-06-17 06:00:00' for example. Here is my code: select date_trunc('hour', t_el_eventlog.eventtime at time zone 'CET') as hours, count (distinct t_el_eventlog.serialnumber) as count...

Setting time zone in weatherData queries

r,timezone,weather
I am using the weatherData package, specifically, its getDetailedWeather function. It returns a data frame, one of the component of the data frame is Time, of class POSIXct. My problem is that all the Time comes set to the local timezone of the machine I am using. I am pretty...

REST API response standards: Timezone

rest,asp.net-web-api,timezone,json.net,asp.net-web-api2
Is there any ISO standard for how we should return a timezone in a REST API? If I return a TimeZone type from a ASP.NET WebApi 2 action, the framework serialises the response model to look like this: { "Id": "Dateline Standard Time", "DisplayName": "(UTC-12:00) International Date Line West", "StandardName":...

PHP DateTime converting issue

php,timezone
I have an issue with converting DateTime from Moscow timezone to New York timezone. Here is my test script: $year = 2015; $month = 3; $tzMoscow = new DateTimeZone('Europe/Moscow'); $tzNewYork = new DateTimeZone('America/New_York'); $startDate = DateTime::createFromFormat('Y-n-d', "$year-$month-01", $tzMoscow); echo $startDate->format('Y-m-d H:i:s')."\n"; // 2015-03-01 16:16:05 $startDate = DateTime::createFromFormat('Y-n-d', "$year-$month-01", $tzNewYork); echo...

Javascript Timezone get Location similar to PHP DateTimeZone::getLocation?

javascript,node.js,geolocation,timezone,location
Does anyone know of a library, function or API that functions the same way as the PHP DateTimeZone::getLocation - http://php.net/manual/en/datetimezone.getlocation.php but for Javascript (or NodeJS NPM). Please note not looking for code just to point me in the right direction. Tried looking for something similar could find anything. For example...

What is this about adjustment rules when converting DateTime to UTC?

c#,datetime,timezone,utc
In the MSDN page for TimeZoneInfo.ConvertTimeToUtc(), there is this info box: If the current computer's local time zone includes multiple adjustment rules, this overload of the ConvertTimeToUtc method can return results that differ from the TimeZone.ToUniversalTime and DateTime.ToUniversalTime methods. TimeZone.ToUniversalTime always applies the current adjustment rule to time zone conversion,...

Android/Joda time - Convert dateTime to my local DateTime

android,datetime,timezone,jodatime
I am trying to convert server date string to my local/device set local time but without success. I am using Joda time library. What i am trying to do: private static String FORMAT_DATE_SERVER = "YYYY-MM-dd'T'HH:mm:ssZ"; public static DateTime parseServerDateToLocal(String raw_date) { DateTime result = DateTime.parse(raw_date, DateTimeFormat.forPattern(FORMAT_DATE_SERVER)).withZone(DateTimeZone.getDefault()); return result; } Still...

why the time is different from my TIME_ZONE in settings.py

django,sqlite,datetime,timezone
I'm using Sqlite for my project database. I need date and time in my model so i'm using this field. date = models.DateTimeField() On the result template(results.html), the time is correct (localtime or TIME_ZONE in my settings.py) The problem is, when i check the database on Django admin page and...

DateTimeOffset parse and custom time zone

c#,timezone,timezoneoffset,datetimeoffset
We are parsing XML DateTime values into a DateTimeOffset value. According to the W3C XSD documentation for DateTime, the type may have a timezone info or not. Our requirment says: If time zone info is provided in XML, use this time zone If no time zone info is provided, assume...

How to parse time zone string “Pacific Time (US & Canada)” on JVM?

java,timezone,jodatime,yammer
I'm writing an integration with Yammer and it returns a time zone string that looks like this: Pacific Time (US & Canada) How does one parse this into a TimeZone or DateTimeZone on the JVM? I've tried TimeZone.getTimeZone and DateTimeZone.forID but to no avail....

PHP - Can't set correct DateTimeZone to DateTime

php,datetime,timezone,datetime-conversion
Background I have a list of events that are set to a certain (UK) time. I want users to see the time of the event in their local time. For example: if an event starts at 20:30 UK time a user from the Netherlands should see the start time...

Why have I diffrent timezone offset result in Oracle DB and in Java?

java,oracle,jdbc,timezone,offset
I have the following code to compare timezone offset of 'Asia/Novosibirsk' timezone in Oracle Database 11g (11.2.0.4.0) and in Java: import oracle.jdbc.pool.OracleDataSource; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; public class TZTest { public static void main(String[] args) { try {...

Python timezone offset wrong? [duplicate]

python,datetime,timezone
This question already has an answer here: pytz.astimezone not accounting for daylight savings? 1 answer I'm writing a python script which contains two lines of code converting the date that got passed into the method to UTC time: print "Timezone: %s" % get_localzone() date = datetime.now(tz=get_localzone()) print "Local time:...

Server side changes date/time sent by client

java,javascript,angularjs,playframework,timezone
I'm facing the following problem, I have a play application with angular and java. In one page the client selects in a calendar some date and time for example 2015-04-03 15:00 this data is put in a javascript object as a Date and later this data is submit to my...

Server and client are python scripts, are there a way to synchronize server to client time without changing system dates anywere?

python,date,datetime,time,timezone
I'm using time and datetime modules in server and in client scripts. When I am receiving data that contains date from server - it is wrong and different to client because of wrong timezone and wrong time on server. How to deal with it and what is the best way...

How to convert from org.joda.time.DateTime to java.time.ZonedDateTime

java,datetime,timezone,jodatime,java-time
I have a data source with joda time DateTime objects stored. I need to convert them into java ZonedDateTime objects, keeping the original timezone. It is not sufficient to keep the offset since some DateTime objects represents daily repetitive tasks, and these tasks must occur at a specific time in...

What is the correct nomenclature for timezones?

datetime,timezone
There are different ways of identifying the same timezone, which can each be used by different programs in different ways. I live in Wisconsin, so we generally refer to the timezone here as "Central Time." But I know that Windows has a registry entry for Central Standard Time, which in...

How to get the timezone offset for the known timezone string?

python,datetime,time,timezone,geoip
I'm using pygeoip package to get the timezone for an IP, >>> import pygeoip >>> gi = pygeoip.GeoIP('GeoIPCity.dat') >>> gi.time_zone_by_addr('64.233.161.99') 'America/Los_Angeles' Is there any packages that can provide the timezone as PST UTC -8:00 America/Los_Angeles Or anything similar in content? ...

Does “GMT Standard Time” imply BST?

c#,timezone
I am confused by "GMT Standard Time". I have data which is stored as DATE only, but is actually 6PM BST. I read it in and add 18 hours. I then try to convert to UTC. My initial understanding is that the conversion would NOT take into account Daylight time...

Can't set timezone using abbreviation

ruby-on-rails,timezone,activesupport
I can't set timezone on Rails using its abbreviation, for example: >> Time.zone = 'BRT' ArgumentError: Invalid Timezone: BRT from /home/braulio/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-3.2.21/lib/active_support/core_ext/time/zones.rb:61:in `rescue in find_zone!' from /home/braulio/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-3.2.21/lib/active_support/core_ext/time/zones.rb:53:in `find_zone!' from...

Is timezone info redundant provided that UTC timestamp is available?

datetime,time,timezone,timestamp,timestamp-with-timezone
I have a simple mobile app that schedules future events between people at a specified location. These events may be physical or virtual, so the time specified for the event may or may not be in the same timezone as the 'location' of the event. For example, a physical meeting...

Convert exists timestamp column data from local time to UTC

postgresql,timezone,timestamp
I used to insert timestamp into my PostgreSQL table in local time. Now I started to use UTC and I need to find a way to convert all dates/times already inserted to UTC time. How am I supposed to do that?

Full calendar Timezone Moment js Issue

javascript,timezone,fullcalendar,momentjs
i've been wrestling with this for a while now, so reaching out for a bit of help please. I have a realtime multi timezone application that uses Signal R, all datetimes are stored and broadcast using UTC and I want to manipulate them client side to avoid multiple broadcasts for...

Referencing timezones in postgres

postgresql,timezone
I need to store timezones for users in Postgres 9.3. A logical solution would be to create a table of timezone names and offsets, and then store an FK reference in my user table. However, postgres already has a view pg_timezone_names which displays the timezone names Postgres knows about. It...

java 1.6 daylight saving

java,date,timezone,dst
I'm working on a critical application which cares about daylight saving time change. I'm trying to simulate manually what could happen at runtime by comparing thow date which cross the daylight saving change, so I made the below test. My current location is Italy so the change from CEST (Central...

Converting Microsoft Timezone to standards timezone data in rails

ruby-on-rails,timezone
I have a rails app that connects to a SQL Server DB, and there's a windows desktop app that connects to the same DB. The Windows app is using the Microsoft windows timezone database so I get a timezone name like Pacific Daylight Time. In rails, the ActiveSupport::TimeZone class gives...

Given an unzoned DateTime and a timezone, how can I construct an instant in NodaTime?

c#,.net,timezone,nodatime
I have a DateTime constructed explicitly. var myDateTime = new DateTime(2015,1,1,0,0,0); I have a timezone obtained explicitly. var myTimeZone = DateTimeZoneProviders.Tzdb["America/Los_Angeles"]; myDate is known to be represented in myTimeZone How should I use this information to generate a ZonedDateTime or an Instant using NodaTime?...

PHP Default Timezone (or Date) with Custom Offset Using date()

php,date,timezone,offset,overrides
In PHP I am using date_default_timezone_set to set the default timezone. Then whenever I use date('m/d/y g:i A') it gives me the correct time for that timezone regardless of location of client. However, I need to be able to set a user-defined default timezone offset when the page loads that...

Google Apps Script: Calendar .getEvents imports events in wrong timezone

javascript,google-apps-script,timezone
Calendar.getEvents works only in PDT time zone not possible to retrieve events in my GMT+02.00 (Europe/Warsaw, CEST) zone. I'am newbie in programming JS and GAS but it's looks like some issue and maybe there is some walkaround for my problem? Utilities.formatDate also treat new Date() as PDT time zone. All...

Equivalent of gmtime in Julia?

time,timezone,julia-lang,strftime
Julia has strftime as a built-in but not gmtime. julia> strftime strftime (generic function with 3 methods) julia> gmtime ERROR: gmtime not defined What is the preferred Julia way to do the equivalent of gmtime? The idea is to turn seconds since the epoch into a time structure in the...

Older dates are parsed as summer time, even if that is not true in java

java,date,timezone
I have a problem displaying a number of dates that are stored as longs. I create the date objects with the constructor that takes the long argument, and then print the dates to a pdf file. However, i have a problem with older dates, when running the program on linux,...

Issue on converting time from local to UTC at DST end date while using TimeZoneInfo.ConvertTimeToUtc(DateTime, TimeZoneInfo) method

c#,.net,datetime,timezone
I have an application that converts local time to UTC and stores it in the database. I encountered this problem while I was testing the conversion during a particular date - 1st November, 2015(the date on which the Daylight savings time ends(the clock goes back to 1.00AM on reaching 2.00AM))....

Converting PST time to Local device time in android

android,datetime,timezone
I am trying to convert PST time to Device local time using below function. It works fine but in London timezone its not working properly. If its 04:58 AM PST then it should show 12:58 PM as per London timezone but its showing 12:58 AM. Am i doing anything wrong...

How to change Tomcat 7's server timezone?

java,tomcat,timezone,tomcat7
My application deployed in a Debian vps in US, Los Angeles. So code like new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) will return current time of America/Los Angeles. Can I do some setting in Tomcat's configuration file (server.xml or catalina.sh or what?) so that get current time will return a specified TimeZone like...

How to get IST time zone in Android

java,android,timezone
I am new to android application development , I am developing an app that is going to run in india only, I want to get the time of asia/kolkata timezone without using "joda" library I used the following code but i didn't get expected output Calendar cal = Calendar.getInstance(); TimeZone...

How to prevent my application to get cached value of TimeZone.getDefault()?

android,calendar,timezone
I am using TimeZone.getDefault() to set the timezone of Calendar class: Calendar cal = Calendar.getInstance(TimeZone.getDefault()); Log.i("TEST", cal.get(Calendar.HOUR) + ":" + cal.get(Calendar.MINUTE)); However, when users change the timezone of their device from Setting, my application represents the time using the former timezone until they force stop (from App info settings) the...

Pytz correct offset of timezones with daylight

python,timezone,pytz
I have a function that return a list of cities + theirs UTC offsets NOW = datetime.datetime.utcnow() ZERO = datetime.timedelta(0) result_list = {} allowed_city = ['Europe/London', 'Europe/Amsterdam', 'Europe/Helsinki', 'Europe/Moscow', 'Asia/Yekaterinburg', 'Asia/Novosibirsk', 'Asia/Shanghai', 'Asia/Tokyo'] for tname in allowed_city: tzone = pytz.timezone(tname) std_date = None try: for utcdate, info in zip( tzone._utc_transition_times,...

Results with difftime in R different from excel and timeanddate.com

r,excel,datetime,timezone
t1 <- strptime("2015-02-17 12:20:00", format = "%Y-%m-%d %H:%M:%S", tz = "America/Chicago") t2 <- strptime("2015-03-13 15:00:00", format = "%Y-%m-%d %H:%M:%S", tz = "America/Chicago") as.numeric(abs(difftime(t1, t2, units = "mins", tz = "America/Chicago"))) The above returns 34,660 while Excel and http://www.timeanddate.com/date/duration.html both return 34,720. R recognizes t1 as CST and t2 as CDT...

.NET TimeZone.CurrentTimeZone.GetDaylightChanges returns wrong DST for 2005

c#,.net,timezone,dst
I used the following code to display the Daylight Saving Time for the years between 2005 and 2035. For the year 2005, this page shows the DST is between April 3rd and October 30th. But the GetDaylightChanges returns March 13 and November 6th. Is the .NET GetDaylightChanges a reliable function?...

Timezone is incorrect [PHP] [closed]

php,datetime,timezone
I am developing locally on my computer with XAMPP, and I have never had problems with the timezone before. I used to live in DC, but moved to Berlin. As soon as I moved I changed the timezone to date.timezone="Europe/Berlin" and I haven't had any problems with that until now....

Fullcalendar wrong time in on click event

javascript,angularjs,timezone,fullcalendar
I'm using angular and fullcalendar. I have (surprise) timezone-issues, and I can't seem to get it right. If in the weekview I click on 08.00 hours, I open a modal and show the time, I see 09.00 hours. timezone: "Europe/Brussels", ignoreTimezone: false, This is (atm) a +0100 timezone, and during...

SQLITE next 24 hours data

android,sqlite,calendar,timezone
i'm looking to select the next 24 hours games from my table: String sql = "SELECT * FROM teamstable WHERE ((teamdate >= datetime ('now')) AND (teamdate < datetime('now','+24 hours'))) ORDER BY teamdate" ; Cursor cursor = db.rawQuery(sql, null); but the result is strange because i have only tomorrow games: String...

Convert datetime to string always defaults to system time zone offset, Need to get the users timezone offset in the result

c#,timezone,offset,timezoneoffset,format-string
I have a code where the user enters the DateTime and the timezone in which the dates needs to be converted to and the format in which the end date should be. Below is the code. The code converts the DateTime perfectly to the timezone the user has entered but...

Query timezone - db server & client machine have different time zones

java,postgresql,datetime,timezone
(This is a follow-up to: Time zone storage in PostgreSQL timestamps) I am using PostgreSQL 9.x, the db server has default timezone as +9 for example, it has a table that contains a column of timezone type. There is a Java program on the same server as the db, it...

Python changes variable/timezone while running?

python,timezone,icalendar
Ok, this is one of the weirdest bugs I've encountered! First: I'm not a Python programmer, and the script is written by friend (who I think took most of it from an example). The purpose of the script: To parse calendar info (times in CET) from a XML-file to an...

Why does Windows Server 2008 think Italy should be in W. European Time?

java,windows,timezone
Why does MS Windows (specifically server 2008 here) consider Italy to be in W. European Time when (I think) it should be in Central European Time according to every other source I can find? TZUtil /g gives: W. Europe Standard Time The control panel shows: (UTC+01:00) Amsterdam, Berlin, Bern, Rome,...

Set timezone doesn't change displayed time in CakePHP 3.x

cakephp,timezone,cakephp-3.0
I am using CakePHP 3.x and have an issue with hours. I have correct hours in my database (MySQL). When my application displays these hours, I have hours in UTC instead of my records. In others words, I have 10:00 recorded in my database and 08:00 displayed on my website...

Understanding momentjs timezones

javascript,timezone,momentjs
I'm using momentjs in my project. To get the current date and time in a given format I'm using this: moment().format('ddd, D MMM HH:mm'); // Tue, 12 May 12:01 If I output this and view in my browser, I see Tue, 12 May 12:01. I'm currently in London which is...

How can I get the ctime and/or mtime of a file in Python including timezone?

python,datetime,timezone
Based on this related question and answer I asked, it has become obvious that datetime.fromtimestamp(os.path.getctime()) in Python 3.4 doesn't return a timezone-aware datetime object, However, based on some investigation, I've also discovered that OS X 10.9 on an HFS+ filesystem (for example) does seem to maintain the timezones along with...

PHP DateTime Timedifference only correct in UTC Timezone?

php,datetime,timezone
Can anybody explain me following behaviours: $end = new DateTime("2015-03-01", new DateTimeZone("Europe/Berlin")); $start = new DateTime("2015-02-01", new DateTimeZone("Europe/Berlin")); $diff = $start->diff($end); //result: DateInterval Object ( [y] => 0 [m] => 0 [d] => 28 [h] => 0 [i] => 0 [s] => 0 [invert] => 0 [days] => 28 )...

Display three letters time zone code using jsTimezoneDetect script

javascript,jquery,datetime,timezone,jstimezonedetect
I am using jsTimezoneDetect script to detect user current timezone. Code below display result as America/Chicago. Is there a way to display CDT/CST (depending on today date)? var timezone = jstz.determine(); timezone.name(); Or is there any other script I can use?...

How to Convert a Time to local Time in Different TimeZone

c#,asp.net,asp.net-mvc,timezone,timezoneoffset
Currently i am working on a chat project from where many users can communicate through each other sitting across the globe. ie: Different TimeZone. eg. 1st in India 2nd in America 3rd in Russia 4th in Australia I am saving my message sent time into database as DateTime.Now.ToUniversalTime() Issue i...

How to convert a timestamp from one timezone to other

sql,timezone,teradata,dst
I have a table with TIMESTAMP column in Teradata. I want to consider the values stored in this column as if they are from 'America Pacific' timezone and convert it into GMT timestamp. I tried, select timestamp_col, timestamp_col at 'GMT' timestamp_col_gmt, timestamp_col at 'America Pacific' timestamp_col_pac, from table_name; timestamp_col timestamp_col_gmt...

created_at and updated_at saving as tomorrow

ruby-on-rails,postgresql,activerecord,timezone
When objects are created in our Rails app, it's saving in the Postgres DB 7 hours ahead of our time (PDT). Looks like it's saving everything to UTC. This really screws up analytic graphs, ect. I have these set in application.rb config.time_zone = 'Pacific Time (US & Canada)' config.active_record.default_timezone =...

How to load time zone data into Moment-timezone.js

javascript,timezone,momentjs
I'm struggling to get the timezone data loaded for use by moment-timezone.js. Below is my code (For brevity, I only added 2 zones, but really need to add a lot more): <script src='/js/jquery-1.11.0.min.js' type='text/javascript'></script> <script src="/s/js/moment.js" type="text/javascript"></script> <script src="/s/js/moment-timezone.js" type="text/javascript"></script> <script src="/s/js/moment-timezone-with-data-2010-2020.js" type="text/javascript"></script> <script> moment.tz.add([...

Eliminating Javascript daylight saving time gap, a cross-browser solution

javascript,date,cross-browser,timezone,dst
After lots of hassle I finally found the actual problem. It's the gap induced by daylight saving and the fact that different browsers act differently if timezone is set on UTC+3:30 (I'm not sure of other timezones). Here's a snippet to generate the problem (the problem is reproducible if your...

Storing event times, UTC issues when DST

java,database,timezone,utc
I searched for this before asking but couldn't find anything that helps. I have a server that uses UTC, the clients can set the time of an event that the server executes daily (this is a simplification). For example someone in France wants an event to happen at 23:00 local...

Python datetime.now() with timezone

python,python-2.7,datetime,timezone
I have a timezone which is float (for example 4.0). I want to construct datetime with given timezone. I tried this, datetime.now(timezone) but it throws TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'float' So I wonder how can I make tzinfo from float?...

What is the scope of moment.tz.setDefault() when used in Meteor?

javascript,datetime,meteor,timezone,momentjs
TL;DR What is the scope of moment.tz.setDefault()? I'm sure my problem here stems from my inexperience with both JavaScript and Meteor but I've been struggling with the problem for several straight days now. I'm working on an app that must take into account the client's timezone but I'm having significant...

Weblogic Server time change

timezone,weblogic12c
We're having a Weblogic Server on which we tried changing the time zone from current GMT to IST(GMT+5:30). This change led to the log file storing the right time zone. However, the data displayed in the application too moved by GMT+5:30. The application is expected to display the data with...

Time zone storage in PostgreSQL timestamps

postgresql,datetime,types,timezone
In PostgreSQL, data type timestamp and timestamp with timezone both use 8 bytes. My questions are: (1) What format is used to store date & time in a timestamp? (2) And how the is time zone information stored in the timestamp with timezone type, and how it's parsed later when...

TZ database and multiple US timezones

python,django,timezone,pytz,tz
I am using pytz to associate time zones with my user profiles. Originally I thought it would just include time zones such as PST, CST, EST, but when I run pytz.country_timezones('US') I receive the following list: [u'America/New_York', u'America/Detroit', u'America/Kentucky/Louisville', u'America/Kentucky/Monticello', u'America/Indiana/Indianapolis', u'America/Indiana/Vincennes', u'America/Indiana/Winamac', u'America/Indiana/Marengo', u'America/Indiana/Petersburg', u'America/Indiana/Vevay', u'America/Chicago', u'America/Indiana/Tell_City',...

How to compare dates while ignoring timezones in Java

java,android,timezone
I'm storing dates and times as one of the fields in my sql database in the following format: dd/mm/yy hh:mm. I am importing this info into my android app with an asynctask and then populating a listview. What I need to do is to check whether or not the date...

Get longer time zone name in PHP

php,timezone,abbreviation
Given a time zone abbreviation like "EST", I can get "America/New York" by using timezone_name_from_abbr. Is there any function that returns something like "Eastern Standard Time"?

PHP Timezone not working correctly

php,date,time,timezone
So we have in-house servers here in this EDT part of the USA America/New_York and for someone reason, this [SSCCE][1] code is not working. <?php echo date_default_timezone_get() . " <br />"; $dateCal = "2015-06-22 13:00:00"; // EDT Time $schedule_date = new DateTime($dateCal, new DateTimeZone("America/Chicago") ); echo $dateCal . " <br...

datetime.now in python different when running locally and on server

python,heroku,timezone,pytz
I am using Heroku to run some python code. The code that i have written uses a predefined time like example: 16:00 and compares that with the current time and the calculates the difference like this: now = datetime.datetime.now() starttime = datetime.datetime.combine(datetime.date.today(), datetime.time(int(hour), int(minute))) dif = now - starttime Running...

fromNow displays different strings on different browsers

javascript,timezone,momentjs
I pass a date string 2015/05/14-02:55 pm to moment.js constructor and i am using fromNow to convert it into a readable format. When i run this command on 16th May, chrome displays right output but mozilla says a few seconds ago. firefox console output: chrome console output: Is this a...

Daylight savings time in java

java,timezone,dst
My requirement is create a combo with all time zone IDs that adjust with "Daylight Savings Time" (DST). With getAvailableIDs() method I can have a list of timezoneIDs like this but the problem is I don't know which one is adjust with DST and ones that do not. So I...

Java Retrieve date records in correct format from mysql

java,mysql,jpa,timezone
I have a table which was populated by a excel. The date in the columns shows according to my system's timezone when a select query is run in mysql. But when i run the same query in java using jdbc connection, i am not getting the correct values as which...

PHP message based on a certain time on different days

php,timezone,message
I'm trying to make an messages appear on my website when we are open and when the phones are "closed" but I can't seem to get it working. This is what I have so far (This is my inspiration http://codewalkers.com/c/a/Date-Time-Code/Display-message-according-to-hour-of-day/) <?php //Change message of the day $open = 'We are...

Pandas date time formatting with timezone shifting

python,datetime,pandas,timezone
I have a sqlite database where each row has a unix timestamp in EST. Changing this is not possible. I put this data into a pandas data frame. I am running a script on a server that is on UTC and when I convert the EST timestamps to date time...