All Questions
Tagged with datetime javascript
5,012
questions
-2
votes
2
answers
32
views
Calculate the time a user has been offline - React JS [closed]
I want to calculate the time the user was offline.
I'm creating a mining app and I want the mining to continue even if the user is offline, I save the date to localStorage every second to be able to ...
0
votes
1
answer
28
views
MomentJS - Create An ISO 8601 Datetime String In UTC Using Date, Time, And Timezone Variables
I have three separate variables I want to use to construct an ISO 8601 datetime string in UTC (without offsets). The three variables are:
Date (in 2024-7-31 format)
Time (in 14:00 format)
Timezone (...
1
vote
1
answer
41
views
Conflicting functions - clock not working.Please can you join me in the right direction
im new to coding. Ive tried to find the answer online but I just can't see what's happening with my code.
I want to make a clock. It will show different time zones. When I click my second function the ...
0
votes
2
answers
63
views
JS skips 2023-10-29 when generating data range
I am trying to generate a sequence of dates. However, when generating JS, it constantly misses October 29, 2023. Could someone explain what could be the reason?
In this post someone noted that on this ...
2
votes
1
answer
47
views
Bind saved Date in Edit Form using Angular 17
I have a form where the date is entered and saved but the date is not binded when I go to edit the form.
JSON:
"checkOut": {
"runDate": "2024-07-05T09:42:00.000Z",
}
...
1
vote
0
answers
32
views
Why does the events in RRule offset by whole 1 day in cases where timezone conversion to UTC was next day?
I have a calendar that shows the recurring events using the RRule. I am on PST timezone so the calendar is also on PST.
When I create a RRule with dtstart where the PST to UTC conversion DOES NOT ADD ...
-5
votes
1
answer
76
views
How to get day's number, month's number and year from a specific date using month's French name? [closed]
I'm completely new to JS Date Object, and I need to get day's number, month's number and year from a specific date using month's French name.
I know how to do it using month's English name:
const dt = ...
1
vote
3
answers
66
views
Make buttons to switch between 12 and 24 hour time that saves to localstorage
I have a clock in my website, and I would like to add a button or switch into settings that switches the time from 12 hour and 24 hour and vice versa.
My problem is that I have no idea where to ...
0
votes
0
answers
29
views
Cannot sort or filter a date in bootstrap-table [duplicate]
I need your help again. Let me tell you.
I have created a bootstrap-table where one of its columns is a datetime that options filter and sort the data in that same column. But when I filter by a date, ...
-1
votes
1
answer
54
views
How To Convert Postgresql Timestamp With Time Zone To UTC In Javascript
I have my postgres table returning a whole bunch of date values client-side formatted like so:
2024-05-14 15:11:38.208073+00
Obviously, +00 indicates this is (properly) stored in UTC format.
From here,...
0
votes
1
answer
33
views
'String was not recognized as a valid DateTime.' in asmx.cs file of asp.net c#
I have Two Input Type = "Date" and one Input Type = "Button"
<input type="date" runat="server" id="dtp_from" />
<input type="date" ...
0
votes
2
answers
76
views
JavaScript Date object showing incorrect date when set to midnight in UTC
I'm encountering an issue with the JavaScript Date object where it's showing an incorrect date when I set it to midnight in UTC. Here's my code:
function updateDates(startDate) {
var utcStartDate =...
0
votes
1
answer
136
views
How do I convert a utc time to a timezoned date object where the timezoned time is the same as the utc was
I have a time like this which is selected in a datetimepicker
let time = 2024-04-22T10:00:00.000Z
i want the user to be able to choose a timezone that the time is in as an example europe/helsinki
i ...
-3
votes
2
answers
91
views
How do I convert milliseconds into a date object?
I am trying to make a function that is, effectively, the opposite of getTime(); it takes a number of milliseconds as an input and converts the number into years, days, hours, seconds, and milliseconds,...
0
votes
0
answers
22
views
Date script failing when imported from another page
I am using a date script on my website as part of my footer composition.
The code should produce the following (example):
© 2004 MYWEBSITE.COM All Rights Reserved
The script works fine in composition ...