Questions tagged [utc]
UTC stands for Coordinated Universal Time - it is the time standard by which the world regulates clocks and time.
2,347
questions
0
votes
2
answers
53
views
How to convert date without timezone [closed]
how to convert date without timezone?
data from the backend comes in the format
1701699255
I'm trying to execute code like this
new Date((1701699255 * 1000) - new Date().getTimezoneOffset() * 60000)
...
0
votes
0
answers
9
views
Removing "01" Prefix from Timestamps in Plot in Python
I am currenlty working on a plot containing two sets of data and fitting linear regression to them. I have a problem with timestamps that i need to have in UTC on the plot (originally in unix). I ...
-2
votes
1
answer
63
views
How to convert dates to UTC taking into account winter and summer time?
My objective is to convert a list of dates to the correct UTC format, i.e.: taking into consideration winter and summer time. Dates were scrapped from a chat.
I am Switzerland based which uses (CET) ...
0
votes
1
answer
48
views
Python Arrow datetime function returns a timestamp with seconds field value more than 60
I have a function in my code for taking a UTC time argument like - 2023-11-06T20:53:39.062Z, convert it to EST time and then return in a format as 'MM-DD-YYYY HH:MM:SS'.
def date_conv(time):
est = ...
-1
votes
0
answers
59
views
Unpredictable behavior of time zone conversion in python [duplicate]
I am facing a problem when converting time from UTC to MSK in Python. I noticed that when I set Moscow time zone in datetime, I get wrong result - offset by +2:30 hours.
Below is the code I'm running (...
0
votes
3
answers
117
views
What is the difference between UTC (ZoneId) and (ZoneOffSet)
Out of curiosity are there any one who knows what the difference is between UTC as ZoneId and ZoneOffset in Java.
I was a little bit surprised that it was not true when comparing utc in zoneid and ...
0
votes
1
answer
51
views
Why local datetime has the same timestamp with utc datetime, no matter its DateTime or DateTImeOffset?
I have checked this question DateTime local and utc the same, but still have no idea.
Here's my code
DateTime localNow = DateTime.Now;
DateTime utcNow = DateTime.UtcNow;
Int64 localTimeStamp = ((...
0
votes
1
answer
25
views
How do I tell Google Apps Script a Date from Google Sheets is in UTC?
I have a Slack workflow updating a Google Sheet with the timestamp the workflow was run.
Slack outputs timestamps as a UTC String, but there doesn't appear to be a time zone attached to it, so Google ...
0
votes
0
answers
47
views
Monkey patching JS Date to force UTC
Everything in our app uses UTC and we want to display it as-is, e.g. 2023-10-10T00:00:00Z from the server is always midnight, it's not 02:00 of 10. October in Prague, it's not 8PM of October 9 in New ...
1
vote
1
answer
545
views
Drizzle ORM date conversion problem between Javascript and PostgreSQL?
Prerequisite: my timezone is GMT+3
I have a model drizzle model
export const events = pgTable('events', {
id: serial('id').primaryKey(),
name: varchar('name', {length: 256}).notNull(),
...
1
vote
1
answer
66
views
How can I form an Inno Setup OutputBaseFilename that includes UTC time
I'm trying to build an output filename that includes UTC time rather than local time.
I start with this...
#define MyDateTimeString GetDateTimeString('yyyy/mm/dd/hh', '-', ':')
Then I have this...
...
3
votes
0
answers
41
views
timezone won't set in docker container, django-image, docker version: 4.21.1
I followed a tutorial on source, added to my image the following code:
`
RUN apt-get update && apt-get install -y tzdata
ENV TZ=Europe/Brussels
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/...
0
votes
1
answer
15
views
trinio sql equivalent for utc date time
I wanted to check if there is trinio equivalent of UTC date time like we have in sql server getUTCDATE(). I basically want current date time but in utc timestamp format for Trinio sql query.
0
votes
1
answer
148
views
How to get the timezone offset for a specific timezone?
I need to sort cities based on their timezone (as TZ identifiers). To do so, the most natural way I found was to compare the offset of these timezones to UTC (but I am open to any solution).
Date....
2
votes
2
answers
61
views
utc time string convert to Unix timestamp, and then convert back to utc date time string. But the result is not matched with the original one
I expect 'utc' and 'utc_str_back' should be the same time, but result is diferent. Here is the code:
#input
utc='2023-09-20T05:04:54'
#calculation
utc_time = datetime.strptime(utc, '%Y-%m-%dT%H:%M:%S'...
0
votes
1
answer
60
views
Why does timezone unaware datetime object print out in local timezone?
When I instantiate a datetime object like this:
>>> print(datetime.datetime.now())
2023-09-16 10:30:15.50
I get the correct local time, which is currently around 10:30 AM.
Why is it like ...
0
votes
2
answers
56
views
datetime.utcfromtimestamp changing time in python
I have a string representing a datetime (ts). I want to transform it to int and then use
datetime.utcfromtimestamp to recover the same datetime:
ts = '2023-07-10 14:06:22.000 UTC'
int_ts = int(...
0
votes
1
answer
49
views
Add and subtract 3 month from a given date time [duplicate]
I have this start date : 2023-09-03T00:00:00+05:30
and end date : 2023-09-10T00:00:00+05:30
I want to subtract 90 days from start date and add 90 days from end date
and then convert it to UTC format
...
1
vote
1
answer
32
views
How to test whether timezone exists in Python/pandas?
I am working with pandas' tz_localize function to convert dates from local time to UTC:
time_zone = 'America/Santiago'
pd.to_datetime(pd.to_datetime(df['mydate']).apply(lambda x: datetime.strftime(...
0
votes
1
answer
61
views
Convert date to format ISO8601 UTC timestamp + ms
I'm using this command to check the last modify date on the file.
stat -c '%y' TEST_FILE.tar
result in this date format: 2023-08-21 05:16:10.802947000 +0200
However in may bash script i want to ...
1
vote
0
answers
42
views
How to convert time object with miliseconds using tcl [duplicate]
I am converting string time to a time object but I am struggling to get the time including miliseconds.
set date1 "2022-01-30 00:00:08"
puts [clock scan $date1 -format {%Y-%m-%d %H:%M:%S} -...
0
votes
1
answer
27
views
Same location with different time in the year PostgreSQL
I got an issue with timestamptz (timestamp with timezone). I have New York time, ex: 2pm NY EST. I will input it as 14:00:00 - 04:00 (UTC-4) because it is July now. However, when it starts from ...
-1
votes
1
answer
73
views
How do I convert and display a UTC DateTime to the browsers local time? [duplicate]
I need to show a UTC date time in the users browser as the users(browser) local time.
Ex. 04:52 UTC -> 09:52 PST (if browser/user is in Los Angeles)
as PST is -7 hours from UTC
I have no ...
1
vote
1
answer
46
views
Get UTC 'T' and 'Z' to show in DataFrame Column
Importing a dataframe in one datetime format, feeding into API service that requires dates in this UTC format (notice the T and Z):
2023-07-26T11:04:23.893Z
Noteworthy is this will be converted into ...
1
vote
1
answer
44
views
time conversion in R using the timevis package
In the following I have a shiny app which add an item to timeline using timevis package. The problem is when user add the first item everything is fine, as soon as user tries to add more item, the ...
0
votes
1
answer
24
views
Failing to convert string do datetime pandas
I'm trying to perform de following operation:
pd.to_datetime('2023-05-02 11:52:09.000000 UTC', format='%Y-%m-%dT%H:%M:%S.%f')
But i'm getting the error: time data 2023-05-02 11:52:09.000000 UTC doesn'...
1
vote
1
answer
57
views
Date - time issue on timevis in shiny app in R
I have a shiny app which I would like to use the timevis package for Gantt chart :
library(timevis)
library(shiny)
ui <- fluidPage(
textAreaInput("addText", "Add item:", &...
0
votes
2
answers
87
views
How to convert difference in hours to timezone in python?
I am currently working with apscheduler with multiple users located in different timezones.
There is no possibility to get the timezone from them automatically, so I need to do this with input data. ...
0
votes
0
answers
66
views
PrimeNg Calendar default date in UTC
I would like to force p-calendar, to always show UTC today date, when click on empty calendar field. I know there is defautlDate option, but this property is set with component init, and it is not ...
1
vote
0
answers
28
views
Why datetime and time isoformat are differents? [duplicate]
from datetime import datetime, time
from zoneinfo import ZoneInfo
time(8, 37, 9, tzinfo=ZoneInfo("UTC")).isoformat()
# '08:37:09+00:00'
datetime.utcnow().isoformat()
# 2023-07-13T08:37:09....
0
votes
0
answers
14
views
IN the utc zone MexicoCity is display as -5 and is -6 . This is afectin several Tradingview charts and Android Phones (local time)
It seems that the library containing UTC time zones Mexico_City is wrong . So automatic detection display a wrong Hour. UTC-5 instead of UTC-6.
I expect that the libraries get a correction. I do not ...
1
vote
2
answers
175
views
Convert UTC to CET (+1 hour) or CEST (+2 hours)
Is it possible to convert Oracle UTC to CET or CEST TIMESTAMP, i.e.
add 1 hour from last October Sunday
add 2 hours from last March Sunday
Query sample
SELECT
NAME,
TO_CHAR(DATE_, 'YYYY-MM-...
0
votes
0
answers
29
views
InfluxDB Correct DateTime in Graph but not in Raw Data
I'm new to InfluxDB and have a strange issue. Couldn't find any solution to this :-(
I'm sending data to InfluxDB and the date/time shows correctly in the graph. But when I select "View Raw Data&...
-3
votes
1
answer
39
views
convert utc date time to utc timestamp in Python
I need to convert date time to UTC timestamp. but the problem is; different systems returns different timestamps based on machine timezone.
example:
date1 = "2022-05-17 04:35:38"
UTC ...
0
votes
1
answer
49
views
R lubridate Time Zone does not give correct conversion to UTC/Zulu time, adds +1 hour
I am trying to convert minutes from midnight (360 meaning 6 AM ) local ( I am in central time) to UTC/Zulu in the ISO 8601 format. However, the results adds +1 hour to the conversion ( 6 hours instead ...
0
votes
1
answer
175
views
Why few hours automatically getting added to date while fetching utc date from postgress with C#?
We have UTC date stored in postgress, I have a requirement where I need to show that date in server's time zone. For that I did changes as below:
selectedAttempt is an object which hold all the data ...
1
vote
1
answer
54
views
Kontent.ai date time picker
I am using the Kontent.ai built in Date & Time picker for a document/file component. When we leave the time field set to 12:00AM for certain dates, the data returned by the API is subtracting an ...
-3
votes
2
answers
122
views
How to obtain UTC format with +0000 in Java? [closed]
I want to change the date format from "20230523154325" to 2023-05-23T15:43:25+0000".
And I have this piece of code, but unfortunately the result is this: "2023-05-23T15:43:25+0300&...
0
votes
2
answers
136
views
Java Current OffsetDateTime object in UTC with three digit fractional seconds (YYYY-MM-dd'T'HH:mm:ss.SSS'Z')
OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneId.of("UTC"));
Above snippet gives me six-digits fractional seconds, but I need a utility method that returns current OffsetDateTime ...
0
votes
1
answer
100
views
How to write Date and Time columns together in column as (yyyy-mm-dd hh:mm:ss+00) in output?
I have various text files(with per minute data) in different folders in following manner. The start date of each file differs but the structure of each file is same as below:
Date/Time Col1 Col2 ...
0
votes
4
answers
594
views
Converting UTC to Local Time with daylight saving in Java
I am trying to convert UTC time to local time, including daylight saving.
Localtime (Stockholm), in summer, should be 2 hours ahead of UTC, but when I convert it in Java it only adds one hour.
public ...
-1
votes
1
answer
332
views
HTML clock with Javascript and different timezones on a website that can be used in every location of the world without access to the internet
I wrote a code for a clock that displays different timezones on the world without using the internet, realized with html and javascript. The clock is included in a intranet website which is reachable ...
0
votes
1
answer
59
views
Converting UTC timestamp by reference
I am trying to convert timestamps for multiple airports in the same data set. The timestamps are imported as UTC – but I want to show each according to its local time zone. I’m using lubridate, ...
-2
votes
1
answer
113
views
How to use UTC to preserve the integrity of time values when the users want the app to present time in their time zone? [duplicate]
Our company has customers in different time-zones, so our app has to store times in a common standard although app users need to see the time using their time zone.
Whatever local zone it is when time ...
4
votes
2
answers
402
views
Convert timestamp with offset to UTC
Conversion
I have a timestamp with an offset (-6) in the following format:
2019-11-30T00:01:00.000-06:00
and I want to convert it to an UTC timestamp, like:
2019-11-30T06:01:00.000Z
Attempt
I tried ...
0
votes
3
answers
219
views
Convert YYYY-MM-DD HH:mm:SS to utc
I have a string input having the following format
YYYY-MM-DD HH:mm:SS
2022-04-14 15:30:00
How can I convert this string to utc format in elixir. Ideally I should look something like this
2022-04-...
0
votes
0
answers
15
views
Handling time zones in mbedOS
I'm working on a school project, where we have to set the RTC on a microcontroller that runs mbedOS. The microcontroller fetches the current unix time, and time-zone offset from an api. I'm currently ...
0
votes
1
answer
51
views
How to check if the current time lies between the two times that open and close in utc timing?
I am trying to check if the current time lies between the two timings open and close.
based on that,I have return the color,tried code but getting wrong result,input timings are in 24 hours clock.
...
1
vote
2
answers
789
views
Wrong offset for America/Mexico_City in php DateTimeZone after Daylight Saving Time cancellation
I have a problem with php in converting dates between timezones.
In particular using the DateTime and DateTimeZone functions I get that the current offset of America/Mexico_City is -5 hours w.r.t UTC (...
0
votes
1
answer
56
views
How to change line to use local timezone (Europe/Ljubljana)? [duplicate]
I'm trying to change:
pytz.timezone('Europe/Ljubljana').localize(datetime.datetime.now().replace(microsecond=0))
to print time in Europe/Ljubljana but it still has offset of 2 hours (uses UTC and not ...