Sign in to follow this  
Followers 0

Timestamp

30 posts in this topic

Posted

How to get the current timestamp with AutoIt?

Cheers

Share this post


Link to post
Share on other sites



Posted

How to get the current timestamp with AutoIt?

Cheers

<{POST_SNAPBACK}>

@HOUR @MIN @SEC

Share this post


Link to post
Share on other sites

Posted

@HOUR @MIN @SEC

<{POST_SNAPBACK}>

A timestamp is the seconds that have gone since the ?. ?. 1970. The date macros don´t help me.

Thanks anyway.

Share this post


Link to post
Share on other sites

Posted

A timestamp is the seconds that have gone since the ?. ?. 1970. The date macros don´t help me.

Thanks anyway.

<{POST_SNAPBACK}>

Do what? What exactly are you wanting... what stands for ?. ?. 1970? I dont understand how that relates to a timestamp.

JS

Share this post


Link to post
Share on other sites

Posted (edited)

A timestamp is the seconds that have gone since the ?. ?. 1970. The date macros don´t help me.

Thanks anyway.

<{POST_SNAPBACK}>

Not sure if that is always the meaning of timestamp ... :idiot:

If you want the know the seconds elapsed since a given date/time then use the Datenew.au3 from my autoit3 stuff page and use command:

_DateDiff("s", $sStartDate, $sEndDate)

Edited by JdeB

Share this post


Link to post
Share on other sites

Posted

Like JdeB said:

@HOUR @MIN @SEC
Will give you a timestamp

You could place this in a variable also:

$timestamp = @HOUR & ":" & @MIN & ":" & @SEC

Maybe you're looking for something different?

Please ... Elaborate

Share this post


Link to post
Share on other sites

Posted (edited)

Do what? What exactly are you wanting... what stands for ?. ?. 1970? I dont understand how that relates to a timestamp.

JS

<{POST_SNAPBACK}>

I mean unix timestamps. I don´t really remember the correct date (LOL), but it was when unix was created.

Not sure if that is always the meaning of timestamp ... :idiot:

If you want the know the seconds elapsed since a given date/time then use the Datenew.au3 from my autoit3 stuff page and use command:

_DateDiff("s", $sStartDate, $sEndDate)

<{POST_SNAPBACK}>

Thank you, I will look for that file.

Sry, I meant unix timestamp. In Germany, we just say timestamp to it.

Edited by gosu

Share this post


Link to post
Share on other sites

Posted (edited)

He's looking for the number of seconds elapsed since the epoch commonly used for computers, January 1, 1970 00:00:00 (Midnight).

Edit: Added time to the date.

Edited by Valik

Share this post


Link to post
Share on other sites

Posted

He's looking for the number of seconds elapsed since the epoch commonly used for computers, January 1, 1970 00:00:00 (Midnight).

Edit: Added time to the date.

<{POST_SNAPBACK}>

Thanks Valik.

That being the case...

You can use the macros and just subtract the epoch from the timestamp.

JS

Share this post


Link to post
Share on other sites

Posted (edited)

Thanks Valik.

That being the case...

You can use the macros and just subtract the epoch from the timestamp.

JS

<{POST_SNAPBACK}>

You lost me.... how would you do that ??

I know the _DateDiff() should be able to do it, but you make it sound like it is simple ...

Edited by JdeB

Share this post


Link to post
Share on other sites

Posted (edited)

It is simple...

#include <DateNew.au3>
$EPOCH = "1970/01/01 00:00:00"
$NOW = _NowCalc()
$time = _DateDiff("s", $EPOCH, $NOW)
MsgBox(4096, "", $time)

Edit: Replaced macro use with _NowCalc() and added #include directive.

Edited by Valik

Share this post


Link to post
Share on other sites

Posted

That is correct. Though I probably wouldnt have done the so easy part of just using your DateDiff function as I generally like writing my own stuff :D

Easy Smeazy :idiot: Thanks Valik for spelling it out for us.

JS

Share this post


Link to post
Share on other sites

Posted

@Valik, i knew how... just liked the way JS made it sound sooooo easy ....

Share this post


Link to post
Share on other sites

Posted (edited)

@Valik, i knew how...  just liked the way JS made it sound sooooo easy ....

<{POST_SNAPBACK}>

I tend to do that. :idiot:

JS

Edited by JSThePatriot

Share this post


Link to post
Share on other sites

Posted

I tend to do that.

JS

<{POST_SNAPBACK}>

I know.... But tryuing to keep an open mind to others when it really can be done in a simple way ... so thats why i said : Show me .... :idiot:

Share this post


Link to post
Share on other sites

Posted

Most things are simple if you know what you're doing. :idiot:

Xandy likes this

Share this post


Link to post
Share on other sites

Posted

Most things are simple if you know what you're doing.  :idiot:

<{POST_SNAPBACK}>

haha... That will go into your quotes for sure.

JS

Share this post


Link to post
Share on other sites

Posted

BTW, I am still working on the whole quotes deal. :idiot: I cant wait till I get some more time. I think it will be big :D

JS

Share this post


Link to post
Share on other sites

Posted

Thread Revival. It seems that the sources used in this thread have long since died and I would like this functionality. Preferabbly in pure autoit(no dll calls or such)

Share this post


Link to post
Share on other sites

Posted

It is simple...

#include <DateNew.au3>
$EPOCH = "1970/01/01 00:00:00"
$NOW = _NowCalc()
$time = _DateDiff("s", $EPOCH, $NOW)
MsgBox(4096, "", $time)

Edit: Replaced macro use with _NowCalc() and added #include directive.

That's great! But how can I "retranslate" a unix timestamp into two variable: $time (for the time) and $date (for the date)?

Cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0