Questions tagged [utc]

UTC stands for Coordinated Universal Time - it is the time standard by which the world regulates clocks and time.

UTC stands for Coordinated Universal Time - it is the time standard by which the world regulates clocks and time.

Questions relating to UTC can relate to date-time formatting, conversions etc.

Definition taken from - WikiPedia

2332 questions
0
votes
1 answer

Date to UTC string return date in one day but comparison return false

I am trying to convert these dates to UTC string with toUTCString() method! const date1 = "2000-01-01T00:00:00Z"; const date2 = "2000-01-01T11:15:02Z"; The result is Sat, 01 Jan 2000 11:15:02 GMT Sat, 01 Jan 2000 00:00:00 GMT: but when I…
0
votes
1 answer

Trouble using utcoffset with Chart.js

I'm trying to use Chart.js with a datetime x axis, and I need to adjust all my values by subtracting 5 hours. Here's some of my code: var timeFormat = 'MM/DD HH:mm'; time: { format: timeFormat, tooltipFormat: 'll', parser: function(utcMoment)…
bernardo
  • 173
  • 8
0
votes
2 answers

How to save datetime in UTC to remote MySQL Server operating at UTC+1?

From an ubuntu 20.04 server I am writing a datetime field to a remote MySQL 5.7 server via Python 3.8. INSERT INTO T1 CREATED = datetime.utcnow().strftime("%Y-%m-%d") The ubuntu server is running at UTC with cron scheduled at 00:30 am. The MySQL…
merlin
  • 2,717
  • 3
  • 29
  • 59
0
votes
0 answers

How to convert UTC to EST in Django

I am trying to convert UTC to EST in a view and display this in a template. Currently the code seems to have no effect. Here is the view: from django.shortcuts import render, redirect, get_object_or_404 from .models import Article from .models…
0
votes
4 answers

Convert UTC time to local time in Javascript, giving future date

I am getting created_at timestamp from backend in UTC format, which i need to render in browser. I am using date pipe in Angular-7. After reading few blogs and stackoverflow, i wrote this function below to get normal date format, which i can pass…
Raj
  • 1,100
  • 3
  • 20
  • 33
0
votes
0 answers

Sequelize.select returns wrong dates

I am attempting to create a web (react/sequelize) front end to an existing database. When I perform a select from the database the returns results in sequelize have the date as off by 1 (-1). Here is the SQL and code used to get the data: let sql1 =…
Johnne
  • 143
  • 10
0
votes
2 answers

How to transform date in React Component

I am trying to convert date and time to simpler format, in particular i'd like to understand how can i convert this: 2020-12-20T09:30:00.485Z (UTC) to this: 2020-12-20 10:30 (UTC+1) in the following React Component ({day.date}): import React, {…
Francesco
  • 549
  • 1
  • 8
  • 14
0
votes
1 answer

Why is my MongoDB Realm GraphQL endpoint returning date like this and how do I parse it in the client

I'm using MongoDB Realm which generates a GraphQL server on top of your data. It only allows primitive types in the resolver return type so I had to return the date as a string. For some reason my date is coming back in this format 0001-01-01…
Oli
  • 3
  • 2
0
votes
1 answer

getting the correct time for specific area \ time zone

I'm currently getting the time in my client using Angular 11 (TypeScript). I have noticed that actually, each user(using my website) can have a different hour , according to his\her location. I'm using the follwoing code to get the current time: let…
JumpIntoTheWater
  • 1,306
  • 2
  • 19
  • 46
0
votes
0 answers

BIGQUERY TIMEZONE conversion on TIMESTAMP. CET to UTC

I am storing one timestamp column in Bigquery table. The source is of CET timestamp. But bigquery is storing it by default in UTC. How to store it as CET timestamp? otherwise while fetching if also I am doing the timestamp conversion it is…
0
votes
1 answer

How To convert UTC into local time on the web with javascript? from http://openweathermap.org/

I am building a weather app using HTML, CSS and JavaScript. I have succeed in displaying my current time but no luck displaying local time of the input city. here is what it looks like: Can I perhaps us getTimeZoneOffset() somewhere? I don't seem…
Emily Scone
  • 129
  • 1
  • 12
0
votes
1 answer

Weird behavior PHP DateTime and DateTimeZone

PHP DateTime and DateTimeZone works incorrectly for me around DST change dates. I wrote a simple function to convert local time to UTC and I called it with the midnight time from the 24th of Oct to the 2nd of Nov with the timezones Europe/Paris and…
Tibor Nagy
  • 1,185
  • 1
  • 15
  • 28
0
votes
3 answers

Excel formula to convert UTC time to Pacific Time

A system I am using provides UTC time in the following format. 20190802145655UT What Excel formula could I use to convert this to a timestamp 8-2-19 7:56:55 AM? I've done a bunch of searches, but the format the time is provided in is giving me a…
MarkSFO
  • 5
  • 1
  • 3
0
votes
1 answer

Get Date Range in UTC

I have the following range that needs to be calculated: const range = (new Date(endDate) - new Date(startDate)) Where startDate and endDate are: "2020-11-03 17:34:24", "2021-05-06 18:34:1" How can I convert this to using UTC so that the seconds…
lost9123193
  • 10,460
  • 26
  • 73
  • 113
0
votes
2 answers

Python `strptime` missing "T" and "Z" when printing?

What am I missing here? Why does this... import datetime start_date = '2020-10-01T00:00:00Z' start_date_obj = datetime.datetime.strptime(start_date, '%Y-%m-%dT%H:%M:%SZ') print(start_date_obj) ...result in: 2020-10-01 00:00:00 ...instead of:…
SeaDude
  • 3,725
  • 6
  • 31
  • 68