Azzera filtri
Azzera filtri

how get date fromthe long number?

4 visualizzazioni (ultimi 30 giorni)
huda nawaf
huda nawaf il 23 Ago 2022
Commentato: Star Strider il 28 Ago 2022
Hi,
The following number represent date
1246573330
How get a date from it ? where I tried datenum,datestr, and datevec, but does not working
Thanks
  2 Commenti
Rik
Rik il 23 Ago 2022
Which date format is this number representing? The Unix epoch?
huda nawaf
huda nawaf il 23 Ago 2022
Unix time stamp

Accedi per commentare.

Risposta accettata

Star Strider
Star Strider il 23 Ago 2022
Spostato: Steven Lord il 23 Ago 2022
D = 1246573330;
DT1 = datetime(D, 'ConvertFrom','datenum')
DT1 = datetime
3413001 CE
DT2 = datetime(D, 'ConvertFrom','excel')
DT2 = datetime
3414901 CE
DT3 = datetime(D, 'ConvertFrom','posixtime')
DT3 = datetime
02-Jul-2009 22:22:10
DT4 = datetime(D, 'ConvertFrom','juliandate')
DT4 = datetime
3408289 CE
.
  10 Commenti
huda nawaf
huda nawaf il 28 Ago 2022
Spostato: Steven Lord il 28 Ago 2022
1123334570
this number what i need to get from 06-Aug-2005 13:22:50, but i do not know how get it
@Star Strider thanks so much
This is what I look for
format longG
>> dts = '06-Aug-2005 13:22:50';
>> dtv = datetime(dts, 'InputFormat','dd-MMM-yyyy HH:mm:ss')
>> dtp = posixtime(dtv)
dtp =
1123334570
Star Strider
Star Strider il 28 Ago 2022
As always, my pleasure!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Tag

Prodotti


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by