UnixDateTimeNumber

Calculates Unix date/time number of a given date/time.
Needed it to pass date/time parameter to Yahoo! finance URL query to read certain company finance for certain timeframe.

Here is the pure Excel function way to do the same.

CodeFunctionName
What is this?

Public

Tested

Original Work
Function UnixDateTimeNumber(FromDate)
    ' Unix timestamp, used at least in Yahoo! Finance
    ' ? datediff("s",dateserial(1970,1,1), dateserial(2021,9,30))
    Rett = FromDate
    Rett = datediff("s", dateserial(1970,1,1), cdate(FromDate))
    UnixDateTimeNumber = Rett
End Function

FromDate

Views 76

Downloads 39

CodeID
DB ID