Questions tagged [timezone]

A time zone is a region on Earth that has a uniform, legally mandated standard time. It is often represented by an identifier, such as "America/Los_Angeles". Do not mistake an offset such as -07:00 as a time zone. A time zone is much more than that. Please read the entire tag wiki for details.

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

Formatting PHP date(); Function To Properly Work With 1st, 2nd, 3rd, 4th And So On

PHP Time Problem (which is most likely very stupid and simple): I need it to print it like this: Wednesday the 4th of Maj 2022 at 07:13:51 But, what I really need for this specific task, is to format ...
Learning WooStoreFront's user avatar
0 votes
1 answer
20 views

Convention on how to interpret a datetime with UTC information and what do Pandas localize and convert functions do with it?

I'm sorry if this not the right place to post, but I have a large dataset of dates from a database, all of which are in the following format, localized to my timezone which is UTC +2: 2023-04-11 10:14:...
rosecabbagedragon's user avatar
2 votes
2 answers
37 views

Convert string to specific datetime/Timezone

Using Powershell, How can I convert this string to US Eastern/Time and just display the time using format HH:mm:ss ? Thu, 30 Nov 2023 17:50:51 GMT Any help is appreciated, thank you!
iceman's user avatar
  • 468
0 votes
0 answers
43 views

Why does PHP output wrong time zone in calls to date()? [closed]

I'm running PHP 8.1.10 on a WAMP Server environment (Laragon) My php.ini is set correctly [Date] ; Defines the default timezone used by the date functions ; https://php.net/date.timezone date.timezone ...
objecttothis's user avatar
0 votes
0 answers
18 views

Change Timezone in hostinger

Goodafternoon everyone, I'm a 4th year student that currently taking a capstone Our website is already uploaded to our host system, which is Hostinger. However, Hostinger uses UTC as its timezone, and ...
mark gabuya's user avatar
0 votes
1 answer
43 views

Convert datetime to user's time

I am using dayjs and trying to achieve a datetime conversion depending on the user's locale. Example; The data I have is 15 April 2024 America/Toronto 16:00. I want to convert this to user's timezone -...
exe's user avatar
  • 33
0 votes
0 answers
27 views

Dotnet 8 Datetime without timezone

We upgraded our solution from DotNet 6 to DotNet 8. Our database is on PostgreSQL. We keep datetime values as datetime without timezone. In DotNet 6 version, we receive datetime values from backend as ...
Ozkan Tuzemen's user avatar
0 votes
1 answer
50 views

POSIX TimeZone String From Swift TimeZone

Is there a way to get a POSIX TimeZone string from the TimeZone data in Swift? I've looked into the TimeZone functions (isDaylightSaving(),nextDaylightSavingTimeTransition(), daylightSavingTimeOffset()...
SamuraiMelon's user avatar
0 votes
0 answers
20 views

How can I change the default time zone in MongoDB using mongosh?

I'm working with MongoDB and using the mongosh shell. I'm trying to set a specific time zone for my MongoDB instance, but it seems like the usual approach using setParameter and the "timeZone&...
Roshan Gamage's user avatar
0 votes
1 answer
55 views

PHP 8.2: Unknown Timezone "America/Ciudad_Juarez" in IntlDateFormatter()

I get in PHP 8.2 a error in IntlDateFormatter if I use "America/Ciudad_Juarez" as timezone: datefmt_create: No such time zone: 'America/Ciudad_Juarez': U_ILLEGAL_ARGUMENT_ERROR Does anyone ...
user706420's user avatar
  • 1,176
-1 votes
0 answers
22 views

How to send alerts from this pinescript based on the color of moving average at a specific clock time?

the following pinescript sends buy and sell alerts. The alerts it sends currently are good as expected. I don't want any changes in existing alerts but want to add new alerts along with old ones. What ...
Vijay's user avatar
  • 3
0 votes
3 answers
47 views

Postgresql config parameter timezone don't change timezone in data base

I change parameter timezone and log_timezone in postgresql.conf by this doc: https://www.postgresql.org/docs/current/datatype-datetime.html From documenttaion: The TimeZone configuration parameter can ...
stim644's user avatar
  • 13
1 vote
1 answer
40 views

Django datetime loaded incorrectly from database

I have a Django application for viewing sensor observations. This is my observation model: class Observation(models.Model): timestamp = models.DateTimeField() sensor = models.ForeignKey(Sensor,...
Marco Breemhaar's user avatar
1 vote
1 answer
44 views

Get time zones using a specific offset for a given moment, in Java

I know: An offset is merely a number of hours-minutes-seconds ahead/behind the temporal meridian of UTC. A time zone is a named history of the past, present, and future changes to the offset used by ...
Basil Bourque's user avatar
0 votes
0 answers
71 views

How to convert string variable which is in UTC to AEST('Australia/Melbourne') timezone using python code [duplicate]

I want to convert string variable which is in UTC format to AEST(Australia/Melbourne) timezone format using python Variable TEST_START(String) is in UTC timezone and It's value shows 2023-11-21 09:41:...
user13748181's user avatar
0 votes
0 answers
37 views

Can we convert timezone text into UTC offset number in Power Query?

My data has two columns: Datetime from different timezones Timezones in text format Data In order to convert those time to my local time, I first need to get the UTC offset numbers based on the "...
Kinsley's user avatar
0 votes
1 answer
52 views

Retrieve aggregated data as per user time zone

I have a postgres database that has all of its data in UTC. If I need to show any data or aggregation for a single day, I can just convert the local time to UTC and use that in my query. However, now ...
muezz's user avatar
  • 37
0 votes
1 answer
21 views

Flutter timezone package tz.local not getting the accurate time of my region

I am trying to get the local timezone in my Flutter project I imported the timezone package and did this import 'package:timezone/data/latest.dart' as tz; import 'package:timezone/timezone.dart' as tz;...
Osama El Emam's user avatar
1 vote
1 answer
48 views

How can I convert from string, apply the timezone offset, make naive and convert back to string a Pandas Series Index in Python?

I have a Pandas time-series object with an Index like this: Index(['2023-05-31T00:05:00+0300', '2023-05-31T00:06:00+0300', ... '2023-09-15T13:48:00+0300', '2023-09-15T13:49:00+...
xpanta's user avatar
  • 8,196
3 votes
2 answers
106 views

How to use the timezone function in ruby's stdlib?

The ruby docs state that I can pass a timezone to the Time initializer: zone = timezone("Europe/Athens") # Eastern European Time, UTC+2 Time.new(2002, 10, 31, 2, 2, 2, zone) #=> 2002-...
Lou Zell's user avatar
  • 5,317
1 vote
2 answers
71 views

ValueError: "time data %r does not match format %r"

I'm trying to parse time using strptime: t = datetime.strptime('2024-08-21T11:00:00 EDT', '%Y-%m-%dT%H:%M:%S %Z') This code works for me in GMT+4, but it fails in GMT-9: ValueError: time data '2024-...
Anthony's user avatar
  • 12.5k
1 vote
1 answer
50 views

Failing test case on timezones on Kattis

I am trying to solve a problem titled Time Zones on Kattis in Python 3. The link to the problem is here My current solution: zones = { "UTC": 0, "GMT": 0, "BST": 1, "...
Ow Ji's user avatar
  • 13
1 vote
1 answer
37 views

Automatic Time Zone detection

How do devices such as computers or mobile phones obtain the time zone information to automatically set their clock? I am developing a microcontroller-based embedded system with Ethernet capability ...
HV16's user avatar
  • 39
2 votes
1 answer
76 views

TimeZone Offset is incorrect for "Egypt Standard Time" on Windows 10

I am trying to convert an UTC date to "Egypt Standard Time", but calculated offset for summer time is different depending on the operating system version: on windows 10, the offset is +2 on ...
MG7's user avatar
  • 141
0 votes
2 answers
88 views

How to get time difference based on timezone?

I need to get time difference in hours and minutes of other user who is situated in anather country. Here is what i have done. const timeZone = "Asia/tokyo"; // Time zone can be changed let ...
coding....'s user avatar
0 votes
0 answers
62 views

How to manage summer and winter datetimes in php [duplicate]

I have a site where I need to store a lot of events with a start and end date. So I store the startDate and endDate at GMT time in the database. However, when France switches to winter time, we end up ...
Niico7507's user avatar
1 vote
3 answers
71 views

Convert UTC to User-Defined Time Zone with ActiveSupport::TimeWithZone

I'm needing to convert a UTC time to the equivalent time in the user's time zone as part of a Rake task. What I want to do is change a UTC timestamp for midnight and re-create the timestamp to be ...
VegaStudios's user avatar
0 votes
1 answer
85 views

Java Timezones - Get Timezones in US or Canada

Is there any way to filter out the TimeZoneIDs to only include time zones associated with the United States or Canada? https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html I am returning ...
AJS's user avatar
  • 21
-1 votes
0 answers
35 views

How to save UTC date in mssql database from Java (JPA)

I want my datetime(or other type) in my database (MsSql in my case) to be in UTC format. In my java backend I have tried to receive it as Date or OffsetDateTime and pass that on to my database. But no ...
Viktor Eriksson's user avatar
1 vote
2 answers
86 views

How to find Unix timestamp of a given calendar date and time in a specific time zone in Javascript?

With APIs like Intl, I can obtain the date and time of any Unix timestamp in any time zone. How can I do the reverse? I'd like to be able to convert any particular triplet of <calendar-date> (...
user22476690's user avatar
0 votes
2 answers
31 views

How to set the timezone different from the client-side in Apache IoTDB?

Since Apache IoTDB is a time series database, I want to know if IoTDB can set the timezone of data storage other than the timezone of client-side. How to configure time zone in interface of IoTDB?
Thoreau I's user avatar
1 vote
1 answer
60 views

python - explanation on different timezone string format for the same

Why datetime.datetime created with zoneinfo.ZoneInfo timezone gives different timezone string with its tzinfo attribute? Using ZoneInfo document says: ZoneInfo is a concrete implementation of the ...
mon's user avatar
  • 19.7k
-1 votes
1 answer
68 views

Local start and end of day in UTC

I would like to find out what the start and end time of a specific day is expressed in UTC and in Python. For instance: the current date and time is Sun 29 Oct 2023, 01:33:49 CEST (Central European ...
Dieudonné's user avatar
2 votes
2 answers
75 views

why does `datetime` module behave this way with timezones?

I am trying to work with time and timezones. I am in the US/Mountain time zone and my computer (Windows) is configured to that time zone. import datetime import zoneinfo utc = zoneinfo.ZoneInfo('UTC')...
Jagerber48's user avatar
2 votes
2 answers
84 views

How to get current date with reset time 00:00 with Kotlinx.LocalDateTime?

I'm using kotlinx.Clock.now() to get current date. Next I need to convert this date to LocalDateTime, here is my code: Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()) It works ...
testivanivan's user avatar
  • 1,102
2 votes
2 answers
71 views

How to use locale for Java ZoneId?

Having an issue when translating my date to other languages. The way its displayed right now is h:mm:ss a VV. My issue is if I swap my locale to zh_TW, it displays as 下午11:59 Asia/Shanghai. I'd like ...
Barry Tone's user avatar
0 votes
2 answers
47 views

Convert Eastern Time to local time from cli

I'm trying to Convert Eastern Time to local time from CLI using the GNU date command. I tried this : $ remoteTime="8:03pm ET" $ date -d "$remoteTime" date: invalid date ‘8:03 pm ET’...
SebMa's user avatar
  • 4,167
0 votes
0 answers
37 views

How to show/convert datetime retrieved from API to a specific timezone

The PostgreSQL database shows: 2023-10-23 04:00:00.000 -0400. The query has no formatting, just a simple column query. The PHP API responds with a JSON showing: 2023-10-23 04:00:00+00. On the PHP side ...
Rodrifting's user avatar
0 votes
1 answer
73 views

How to get timezone from local and UTC timestamps java

I have a use case where the data coming as input does not specify the timezone, however we have two separate fields "local" and "utc", which can in practice denote the offset, and ...
saurabh.kg001's user avatar
1 vote
0 answers
61 views

JQ convert UTC datetime to local daylight saving time

How to convert UTC datetime to local daylight saving time (AEDT) using JQ (jq-1.6) date -d"2023-10-19T04:59:59Z" Thu 19 Oct 2023 15:59:59 AEDT JQ returns the localtime but not in DST (1 ...
surz's user avatar
  • 103
0 votes
1 answer
52 views

How to get the date for a specific time zone [closed]

I need to get the date for a time zone with javascript but Date instances get the date of the time zone in which the user is located. This is the code I used: const date = new Date(); let year = date....
Eliseo's user avatar
  • 127
0 votes
0 answers
29 views

Display 4 current/live times from different timezones that update with Javascript

I want to display 4 timezones, GMT (BST now), CET, EST, PST, on a webpage. These times should update 'live' so the hour/minute counter updates. I almost have this working but in my JS only the first ...
user1406440's user avatar
  • 1,369
1 vote
1 answer
54 views

How to check if a datetime value is valid (and not in time gap caused by DST change)?

Daylight Saving Time (DST) changes occur usually twice a year. During fall clocks are moved backwards which creates a fold which means that a given local time has two possible meanings. This is ...
Niko Fohr's user avatar
  • 29.2k
-1 votes
1 answer
104 views

Zoned date time is not giving est time [duplicate]

I want to convert the date and time to EST zone and I tried using calendar for some reason it is not converting the time even though it is setting the timezone correctly. And I am trying zonedDateTime ...
HARI KRISHNA's user avatar
1 vote
0 answers
33 views

Hour of LocalTime & OffsetTime are not persisted correctly using Hibernate

I pushed a minimal example on GitHub which you can test here. In the example you can see that i am trying to persist an Entity with LocalTime and OffsetTime properties. But a time of 15:30 get ...
bentinhoj's user avatar
0 votes
1 answer
72 views

Changing Time Zone to EST

Good Morning, I am using the code below that someone lovingly provided online, to create "backups" or copies of a google sheet each night. The issue is that the timestamp is in GMT and I ...
AshleyP's user avatar
1 vote
1 answer
55 views

Getting NonExistentTimeError in pytz

With this example: import pandas as pd import pytz timestamp = pd.Timestamp('2023-04-30 02:20:28.594000') timezone = pytz.timezone('Africa/Casablanca') print( timestamp.tz_localize(timezone, ...
David Masip's user avatar
  • 2,252
1 vote
1 answer
57 views

MongoDB saves some dates incorrectly and with different offsets

My server Timezone is Tehran (GMT+3:30). When I run this command var now = new Date(); now.getTimezoneOffset(); I get -210 which is correct. but when I save 2 dates in database, MongoDb saves them ...
Nima Masghadi's user avatar
1 vote
0 answers
168 views

Why is the time zone in my JavaScript console incorrect?

I am in the 'Asia/Shanghai' time zone and have set my computer system's time zone accordingly. However, when I retrieve the time zone using Chrome's console, the returned result is 'America/Chicago'. ...
acwind's user avatar
  • 111
1 vote
1 answer
98 views

Why do these datetime conversions using pytz not land on hours before December of 1901?

Perhaps I am not using the libraries correctly, or perhaps there was some kind of standard change on December 15, 1901 concerning world wide time keeping. But I stumbled across this odd behavior while ...
Andrew Allaire's user avatar

1
2 3 4 5
247