Questions tagged [timezone]

1

votes
2

answer
41

Views

Change default timezone in ASP.NET Core 2.2 on Docker for 24h time format

I want to use German date formatting as default for my ASP.NET Core 2.2 application. On my Win10 machine with German language/layout it works, so I assumed that the timezone has to be set in my Dockerfile. According to the Alpine wiki, I did this: FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine3....
Lion
1

votes
2

answer
22

Views

Parsing a TimeZone name string that includes GMT offset hours

I did find this question but I am still stumbing around looking for a simple solution to the following: An API call returns the following format which looks like they are using Time.zone.to_s irb> ShopifyAPI::Shop.current.timezone => '(GMT-08:00) Pacific Time (US & Canada)' I would like to parse th...
kg.
0

votes
0

answer
7

Views

How to make Django DateTimeField to store Pacific time with UTC format

After reading many doc, I am confused by UTC, UTC timezone and how it's used in Django. Is UTC format and UTC timezone same thing? Can UTC format store Pacific timezone date+time? I have a django project with database and UI. class FunModel(models.Model): fun_time = models.DateTimeField() What I am...
user3792705
0

votes
2

answer
19

Views

convert date based on timezone user is in

I have a date I want to convert based on their timezone. For example, I want to set it in EST time (America/New_York) 2019-04-24 12:00:00 and if the user comes across the site from America/Los_Angeles, it will appear: 2019-04-24 09:00:00 I need to be able to return the hour, so in that example: 9. I...
Brad
1

votes
2

answer
718

Views

How to parse Timezone Offset string?

I retrieve a value from my database of a timeZone offset. The value that I get is in time. For example, it could be '-5:00', '+7:30', '+3:00', etc. How do I convert that to a double so I can do an AddHours() call on a DateTime object?
rmh
1

votes
1

answer
40

Views

Convert ISO 8601 string in UTC to local time - JodaTime is adding the opposite of local time zone

Say I have a String equal to 2019-02-23T07:58:21. This is a time retrieved from a system clock in UTC. I want to convert the time to what it would be in the system's local time. I'm using JodaTime because it seems like it can easily do what I want. What I've tried: DateTimeFormatter dateParser = ISO...
TheKingElessar
1

votes
2

answer
79

Views

Qt QDateTime from string with timezone and daylight saving

i am inserting time from string QDateTime time =QDateTime::fromString('Wed Mar 26 22:37:40 2019 GMT-08'); qDebug()
Awais Rafique
1

votes
2

answer
63

Views

How to find out if DST was effective for some date in Python?

I have following data: geographical coordinates of the place and local date and time, not necessarily current, may point to some moment many years ago. I also may have non-DST time zone effective currently, at present time (but not necessarily correct for the date and time of interest). I want to...
ivan.ukr
1

votes
1

answer
33

Views

Automagically detecting timezone from reliable system sources

I'm writing a CLI PHP script, and I want the log messages it'll display to contain the correct local time. This script will be being included in a small software release and run on different machines (on Linux) as part of a configuration step. I only need the time to correctly timestamp log messages...
i336_
1

votes
2

answer
381

Views

Google Sheets Custom Function API: Return Sunrise/sunset + GMT/DST Offset based on lat/long

I'd like to have the function return the sunrise or sunset formatted with the appropriate GMT offset based on the coordinates. I found a different API that lets you get sunrise/set times for a given date and location as well as providing GMT or DST offset. function SunRiseSet(lat,long,date,type) { v...
Jeremy Bauman
1

votes
1

answer
302

Views

Which timezone does Puppeteer configure Chromium for?

Using Puppeteer 0.13.0, I'm wondering which timezone it configures its Chromium instances for? It appears to me, from my testing, that Chromium will use UTC for timezone, but I can't find any confirmation of this anywhere. For example, if I log the current time, via console.log(new Date()) in the Pu...
aknuds1
1

votes
1

answer
182

Views

Converting day lights savings time string to timestamp gives wrong results

I have a pyspark data frame. In this data frame I have a column called test_time which is of string datatype >>> df DataFrame[test_time: string] df.show() +-------------------+ | test_time| +-------------------+ |2017-03-12 02:41:06| |2017-03-12 02:43:52| |2017-03-12 02:56:32| |2017-03-12 0...
User12345
0

votes
2

answer
815

Views

How to change Heroku daylight saving setting

I could manage to change time zone on Heroku but still it is giving one hour less than my local time. Can anyone help on how to set DST (daylight saving) offset on Heroku?
GoGreen
1

votes
0

answer
46

Views

Time comparison for various zones in rails

I am developing an application for US based client. There is a functionality that user can not park a vehicle for more than 4 hours. My database time is stored in UTC. I have below line in my view file to not to display vehicles who have already passed four hours since they have parked vehicles, Th...
Hemant Patil
0

votes
0

answer
6

Views

Get First day of last month timestamp with Carbon

I want to get the timestamp in milliseconds for first day of last month and last day of last month using Carbon in laravel. I have tried to do it with carbon::parse, which is achieved. But I want to instantiate the Carbon class simply to achieve the same. This is the code that works fine with Carbo...
Shraddha Banerjee
1

votes
0

answer
65

Views

Angularjs and Java - Different hours between timezones

My web application uses in front end bootstrap 3.3.7, ui-bootstrap-tpls-2.0.1 and angular 1.5.8. In back end Java 8, tomcat 8 and provide JSON rest services. The TimeZone in server is America/Sao_Paulo, in frond end is America/Bahia. The Html for input date uses uib-datepicker-popup='dd/MM/yyyy' Fo...
Melly Louise
1

votes
0

answer
234

Views

Spring Boot repository returns wrong value when persisting LocalDate with Liquibase configuration

I have a small Spring Boot project; all the application does is persist a simple entity with a LocalDate and a LocalDateTime. To ensure uniform date formatting across application servers in different time zones, I set the default Java timezone to UTC after startup. I have a set of integration tests...
zzardvarkq
1

votes
0

answer
205

Views

Django Unit test : `freeze_time` not work well in some cases (Seems like a bug..?)

This is my code for testing the role of TIME_ZONE and `USE_TZ: from django.test.utils import override_settings class TimeZoneTest(TestCase): @override_settings(TIME_ZONE='UTC', USE_TZ=True) @freeze_time('2018-01-04 13:30:55', tz_offset=9) # The reason that I add tz_offset=9 is to make local time sam...
user3595632
1

votes
1

answer
413

Views

I'm trying to build an RFC3339 timestamp in C. How do I get the timezone offset?

I'm attempting to put together an RFC3339 timestamp which will be used to write a certain entry to a database. That would be formatted as, for example, 2004-10-19 10:23:54+02, where the +02 is the offset in hours from GMT. It's this offset which is proving troublesome - I can't seem to derive this v...
K. Haskins
1

votes
1

answer
158

Views

Are Alexa skill dates the same in the Service Simulator and the Echo?

My Alexa node.js skill involves getting the current date using 'new Date()'. In the Service Simulator the date returned is UTC. But I need the time in 'America/New_York' -- my skill is local to New York. So I can convert the time zone, no problem. But I'm wondering whether this will get the same...
scrayne
1

votes
1

answer
36

Views

Django does not seem to account for DayLightSavings

In my models I want to update the last_edited value of the Submission object everytime the UserAnwser object is saved. To this end I've written the following code from django.utils import timezone ... class UserAnswer(models.Model): answer = models.FloatField() question = models.ForeignKey(Questio...
Jasper
1

votes
1

answer
81

Views

Django TruncMinute show timezone

I created a Django ORM query and I use TruncMinute to set seconds to zeros. Unfortunately when I run my query the result show my timezone. I attached my result with my query and I also show my desired output. My query: MyResul=MyTable.objects.all() .filter(time__range=(start_date, end_date)) .annot...
1

votes
1

answer
206

Views

recipient timezone not working when sending a push notification for AUS, US and Europe

The problem we would like to understand and work around is delivering push notifications to players that are in different timezones and regions, all at the same local time. It would appear the recipient timezone option is not working when setting up a recipient timezone push notification. We run tim...
Chris Peters
1

votes
0

answer
655

Views

Set correct time zone for data from jdbc connection in Spring Boot microservice

In my Spring Boot microservice I have jdbc connection configured to MSSQL database. There are about 10 different queries and among the fields there are some timestamps. The server is located in Switzerland, all timestamps are in Swiss time. My service need to return UTC time but all data I get from...
Vitalii
1

votes
0

answer
89

Views

Quartz CronTriggerImpl computeFirstFireTime trigger timezone

As per the Quartz code in CronTriggerImpl, public Date computeFirstFireTime(org.quartz.Calendar calendar) { nextFireTime = getFireTimeAfter(new Date(getStartTime().getTime() - 1000l)); This ignores the timezone field and uses the system timezone even if the timezone was set on the Cron Trigger. pri...
user2549686
1

votes
1

answer
140

Views

Can't get Time.use_zone to change Time.zone

I'm trying to setup my rails app to use the timezone set in the User model. The User model saves the timezone as a string and then in the application I am setting the timezone from the current users timezone as described on this page: https://www.varvet.com/blog/working-with-time-zones-in-ruby-on-ra...
jfredson
1

votes
1

answer
94

Views

timezone differences between utime() and stat()

I have a Windows C program that downloads files from a unix server along with their modification times. It then saves a local copy in a cache and sets its timestamp to match the timestamp on the server - so it won't need to pull a fresh copy if the local copy is up to date. Anyway, it uses utime()...
littlenoodles
1

votes
1

answer
116

Views

Zapier Code (NodeJS) toLocaleString() timeZone

While attempting to utilize the code below: //Placed here for continuity sake var inputData = { content: 'Created: 2018-03-06T13:58:35.660Z\nName: Operator\nText: test\n\nCreated: 2018-03-06T14:00:16.093Z\nName: Operator\nText: test' } //Actual code in Zap var transcript = inputData.content.rep...
Sean Keough
1

votes
2

answer
96

Views

Laravet Carbon date setTimezone(8) giving +0700

I want to set timezone to GMT+8 $data = Carbon::now(); $data->setTimezone(8); but the result given is Carbon @1521099609 {#2145 date: 2018-03-15 14:40:09.759487 Asia/Krasnoyarsk (+07:00) } I have no idea why it happen, so I must use timezone name to get exact date I want?
Yu Yenkan
1

votes
1

answer
63

Views

js weird date conversion

I've got an application that displays physical persons personal records, including birthdate. Everything was going well, until someone pointed out the fact that the date was incorrect by one day. I started to dig a bit and found this strange behavior on JS Date object: new Date('1969-10-25T00:00:00'...
Thomas Ayoub
1

votes
3

answer
292

Views

DateTime conversion adds one extra hour

I have an input time in UTC and want to convert it to the device's local time. I want to use the TryParse method to avoid exceptions. The input time is 7 PM. Expected out DateTime date parameter is 20:00. Instead it becomes 21:00. My time zone is GMT+1 Central European Time. It is not currently DST,...
1

votes
0

answer
28

Views

Strange behavior of the timezones with `unnest()`

The behavior of unnest() regarding the timezones seems strange to me. library(tidyverse) library(lubridate) Sys.getenv('TZ') #[1] 'Europe/Paris' reprex_unnest % mutate(datetime = ymd_hms(datetime, tz = 'UTC') , datetime_locale = map2(datetime, locale, ~ with_tz(.x, tzone = .y) ))%>% unnest(datetime_...
JeromeLaurent
1

votes
1

answer
254

Views

Order confirmation email shows wrong timezone in summer time

When I created an order,the order confirmation email showed me the wrong time. The order created time on order list of dashboard is correct, just shows EDT. The 'created_at' column of 'sales_flat_order' table stores the order time as UTC. Order email's time is 'UTC+1'. I do have to show the EDT ti...
Igor Revenko
1

votes
1

answer
105

Views

EDT or EST? Dynamically set 3 letter timezone based on daylight savings

Given a timezone like 'EDT' in java, is there a way to set an arbitrary datetime in java to be in that timezone and print with the correct label, (either EDT or EST)? Some context: I am developing a weekly report generation feature that needs to timestamp reports in the timezone of the user who firs...
gabeR
1

votes
1

answer
194

Views

Why iOS 10 Calendar.current.timeZone not return my local timezone?

In iOS 10, Calendar.current.timeZone returns GMT. While in iOS 11, Calendar.current.timeZone returns my local timezone, which is correct. Is that a bug in iOS 10? How to workaround it?
shoujs
1

votes
1

answer
96

Views

Difference between timezones with Carbon

Time in CEST = UTC time+2h but my code showing only 1h and I don't know why... (you can test it here ) require 'Carbon/Carbon.php'; use Carbon\Carbon; $timestamp = '2018-04-06 14:30:00'; $date = Carbon::createFromFormat('Y-m-d H:i:s', $timestamp, 'UTC'); var_dump($date); //{ ['date']=> string(26) '2...
Bolek Lolek
1

votes
1

answer
46

Views

Format a time zone offset

If I have a TimeZone, the string property currently produces the time zone in ISO-8601 format. import ceylon.time.timezone { OffsetTimeZone } shared void run() { value timezone = OffsetTimeZone(27000000); print(timezone.string); // +07:30 } Is there a way to get it in other formats, specifically wit...
drhagen
1

votes
0

answer
111

Views

AlarmManager not working after change Timezone

Calendar mCalendar = Calendar.getInstance(); mCalendar.setTimeInMillis(System.currentTimeMillis()); mCalendar.set(Calendar.HOUR_OF_DAY, selectedHour); mCalendar.set(Calendar.MINUTE, selectedMinute); mCalendar.set(Calendar.SECOND, 00); long startUpTime = mCalendar.getTimeInMillis(); if (System.curren...
Gaurav Mandlik
1

votes
1

answer
324

Views

Javascript Date is not formatting correctly using `toLocaleString`

I am trying to format date in 'MM/dd/yyyy' (short date format) using toLocaleString function of javascript Date. But it is not giving expected result when I change my timezone. Bellow is snippet of my code var d1 = new Date(1954, 0, 1); // Fri Jan 01 1954 00:00:00 GMT-0900 (AKST) var options = { yea...
Ajax
1

votes
0

answer
43

Views

Timezone conversion not working on my server

This PHP code is supposed to convert an Australia/Sydney datetime to UTC. It doesn't work. The resulting datetime is unconverted: $local_datetime = '2018-04-11 16:01:48'; echo 'Local datetime: $local_datetime'; $local_timezone = new DateTimeZone('Australia/Sydney'); $datetime = new DateTime($local_d...
latearrival

View additional questions