Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Timestamp


  • Please log in to reply
29 replies to this topic

#1 gosu

gosu

    Adventurer

  • Active Members
  • PipPip
  • 112 posts

Posted 07 December 2004 - 06:53 PM

How to get the current timestamp with AutoIt?

Cheers

Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.

View Post








#2 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,356 posts

Posted 07 December 2004 - 07:06 PM

How to get the current timestamp with AutoIt?

Cheers

<{POST_SNAPBACK}>

@HOUR @MIN @SEC

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#3 gosu

gosu

    Adventurer

  • Active Members
  • PipPip
  • 112 posts

Posted 07 December 2004 - 07:21 PM

@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.

Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.

View Post


#4 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,692 posts

Posted 07 December 2004 - 07:27 PM

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

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)


#5 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,356 posts

Posted 07 December 2004 - 07:27 PM

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, 07 December 2004 - 07:28 PM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#6 sykes

sykes

    Haiku Computer Operator

  • Active Members
  • PipPipPipPipPipPip
  • 422 posts

Posted 07 December 2004 - 07:29 PM

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
We have enough youth. How about a fountain of SMART?

#7 gosu

gosu

    Adventurer

  • Active Members
  • PipPip
  • 112 posts

Posted 07 December 2004 - 07:31 PM

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, 07 December 2004 - 07:32 PM.

Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.

View Post


#8 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 07 December 2004 - 07:39 PM

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, 07 December 2004 - 07:42 PM.


#9 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,692 posts

Posted 07 December 2004 - 07:55 PM

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

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)


#10 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,356 posts

Posted 07 December 2004 - 07:59 PM

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, 07 December 2004 - 08:01 PM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#11 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 07 December 2004 - 08:06 PM

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, 07 December 2004 - 08:11 PM.


#12 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,692 posts

Posted 07 December 2004 - 08:08 PM

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

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)


#13 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,356 posts

Posted 07 December 2004 - 08:12 PM

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

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#14 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,692 posts

Posted 07 December 2004 - 08:13 PM

@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, 07 December 2004 - 08:19 PM.

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)


#15 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,356 posts

Posted 07 December 2004 - 08:16 PM

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:

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#16 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 07 December 2004 - 08:18 PM

Most things are simple if you know what you're doing. :idiot:
  • Xandy likes this

#17 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,692 posts

Posted 07 December 2004 - 08:20 PM

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

<{POST_SNAPBACK}>

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

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)


#18 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,692 posts

Posted 07 December 2004 - 08:24 PM

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

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)


#19 sunrunner20

sunrunner20

    Seeker

  • Active Members
  • 6 posts

Posted 07 June 2006 - 12:48 AM

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)

#20 dunno

dunno

    Seeker

  • New Members
  • 3 posts

Posted 08 June 2006 - 01:14 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users