All Questions
Tagged with unix-timestamp momentjs
44
questions
1
vote
1
answer
57
views
How do I assign an array time ranges to each day of the week?
What I want to create using the my code is an array of 7 objects as illustrated below:
(7) [{…}, {…}, {…}, {…}, {…}, {…}, {…}]
These objects are 7 because they represent each day of the week, as seen ...
1
vote
1
answer
130
views
how do I calculate the remaining time left from a given unix formated data before the day in javascript
I have two Unix timestamp data(I am getting from client side)
const orgStartTime = 1603801800; // Tue Oct 27 2020 23:00:00 GMT+1030 (Australian Central Daylight Time)
const orgEndTime = 1603807200; ...
0
votes
1
answer
301
views
Compare client timezone to CET timezone
My website is using the timezone from my server, which is CET.
So the unix-timestamp that is always parsed using
new Date(timestamp * 1000)
to the timezone of the server, and not the client.
However, ...
1
vote
3
answers
2k
views
JavaScript expired time
I need a function that will add 24 hours to a unix timestamp. Then I need to check how much time is left between the creation of the timestamp and the 24th hour as time goes by. This will serve as an &...
1
vote
1
answer
57
views
Issue in converting Unix timestamp get from moment to normal date
I am using moment().valueOf() to get unix timestamp and to get the normal time from unix time i'm using moment.unix(unix_time).format('LLL') when the unix value is 1606985226404 getting the anser as ...
1
vote
1
answer
606
views
Timestamp conversion in to Date format giving me Wrong date In JavaScript
In my application, A user from US created a offer on 30th November 2020, while getting the search response in UI, I am getting created timestamp as 1606786157.343 ,When I am converting in to date ...
1
vote
1
answer
71
views
Why isn't my Unix time parsing consistently?
My client generates a timestamp using Date.now(), generating a unix time in milliseconds. But when I parse it later on the server, I get a very different date. I can reproduce this discrepancy with ...
1
vote
1
answer
775
views
How to obtain unix timestamps for same date in 2 different time zones with moment.js?
I'm working on an app where users can choose what time zone they are recording time in. But internally, I want to store the time as a unix timestamp.
Say I have a date '2016-01-01 1:00 pm'. If I store ...
0
votes
1
answer
300
views
Adding hours (x) in a given unix timestamp
I have the following function using moment which checks the difference in minutes from a given UNIX timestamp. actualStartTime is in unix format (for e.g 1599226113699)
const endTime = moment(offer....
1
vote
2
answers
3k
views
How can I get the current time using timezone offset using moment.js?
I am using https://openweathermap.org/current api and i want to get current date and time of the target city, I am getting timezone (shift in seconds from UTC) value from api, so how can i get the ...
1
vote
1
answer
203
views
Use Moment.js to convert human readable time to Unix epoch time
I'm trying to use Moment.js to convert a human readable time to a Unix epoch time. I'd also like to know.
35 MIN AGO to Unix epoch time
1
vote
1
answer
757
views
Need to receive local UNIX Timestamp using Moment.js rather than UTC Timestamp
I want to convert local datetime to unix timestamp(seconds) using Moment js. I have used following formulas:-
moment().unix()
moment(new Date()).format("X")
Example:-
a) IST Time - 11th April 2020 ...
0
votes
3
answers
43
views
How to fix the bellow code that is meant to add minutes to timestamp and final value should be also in timestamp as I will do some database queries?
var startDate = 1582530967;
var intervalDate = moment(new Date(startDate)).add(30, 'minutes').toDate().valueOf()
console.log(intervalDate);
The above codes makes bug adding 30 minutes makes it
...
0
votes
2
answers
2k
views
get previous hour/previous day timestamp from a unix value
i have an epoch timestamp of 1567318967 (September 1, 2019 6:22:47 AM). From the given epoch timestamp, How do I get the previous hour and previous day and output the result in epoch using Java?
I.e. ...
1
vote
2
answers
149
views
moment.js not factoring in the year when converting a date to Unix timestamp
I need to find the difference between 2 dates, 30/05/2019 and 30/04/2020. I am using this code:
var checkinTime = moment('30/05/2019', 'DD/MM/YYYY').unix();
var checkoutTime = moment('30/04/2020', '...