How to convert excel date to timestamp [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I got array of dates from excel file and they look like strange fractional numbers: 42425.4166550926, 42419.3326041667, 42411.5419097222, etc. How to convert them to unix timestamp or javascript date?

To convert date to timestamp, a formula can work it out.
Select a blank cell and type this formula =(A1-DATE(1970,1,1))*86400 into it and press Enter key, if you need, you can apply a range with this formula by dragging the autofill handle. Now a range of date cells have been converted to Unix timestamps.
Source
Another source...

Related

How to convert an UTC date time(ISO format) into Locale date time (ISO format) in Node Js? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
I have an UTC time from MySQL like this - "2023-02-18T06:00:00.000Z". I have to convert this into Locale time in ISO format.
I have used .toLocaleString() function, but it is giving me date time in readable format, I need the UTC time converted into Locale time in ISO format just like it saved in the MySql. How to get that?

javascript - new Date('1611065280155').getDate() returns NaN [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am trying on the Google console.
new Date('1611065280155').getDate() which returns NaN and I was expecting 'yyyy/mm/dd' similar format.
How do I get the date from a milliseconds?
I was referring to https://www.codegrepper.com/code-examples/delphi/get+the+date+in+different+format+javascript but since there are many functions and got confused
You could use Date with a number as value for handing over epoch time.
console.log(new Date(1611065280155));

display time and date in GMT or UTC [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am trying to display GMT/UTC time with current date LIVE
i can display current time with it will be fixed until did refresh for the page
what i need to do display the time and date in UTC/GMT in my page as PHP or java code
thank you
If you want to convert your current time to another timezone lets say GMT or UTC then you can follow the following steps for javascript:
You can use moment-timezone lib.
const moment = require('moment-timezone')
const now = moment().format()
moment.tz(now, 'UTC').format()
moment.tz(now, 'GMT').format()

how to get the html5 time input to display 00:00 instead of 12:00 in the input field? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
the original input field display is hh:mm am/pm, I got some CSS codes that turned the display into hh:mm:ss, but it won't display 00:--:-- even if the input value is 00:--:--, instead it displays 12:--:--. is there a way to fix this? perhaps by CSS or JS?
edit: is there another way to have a similar styled input field that takes input in the form of hh:mm:ss into "hh:mm:ss"?
If you are using -
<input type="time" name="time" />
Then Chrome may not display it in 24 hour format but other browsers may.

javascript count backwards 23 week days from current day for stock tracking [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am working on an application to get historical stock data from yahoo finance csv api. I am having trouble creating a script that will get the current day and count back 23 weekdays (not counting weekends or holidays). The idea is that it will plug the two dates in at yahoo, get the historical data and then create a moving average. I am unsure how to do this using the date function though.
You could use the Moment.js library, if you are able to provide that to your page. You could use it to do something like this:
var today = moment();
var pastDate = today.subtract('days', 23);
// then do something with those two variables...
if you need them in a certain format before you pass them along, just call .format on them
getHistoricalData(today.format('YYYYMMDD'), pastDate.format('YYYYMMDD'));

Categories