+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, AutoIt time script in Coding and Web Development; Hi, I need help creating a script in autoit which will display the local time in a message box and ...
  1. #1
    My220x's Avatar
    Join Date
    Feb 2008
    Location
    UK
    Posts
    257
    Thank Post
    9
    Thanked 3 Times in 3 Posts
    Blog Entries
    8
    Rep Power
    14

    AutoIt time script

    Hi, I need help creating a script in autoit which will display the local time in a message box and will say "The times is:"

    All I have is:

    Code:
    ; Script Name : Change Background
    ; Author : Daniel Lambert
    ; Created : 2008
    
    $time = ""
    
    
    
    
    MsgBox (0, "Time Is", "The time is:" $time)
    I am really stuck on the function to show local time.

  2. #2

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,068 Times in 625 Posts
    Rep Power
    740
    Use the time macros:

    @SEC Seconds value of clock. Range is 00 to 59
    @MIN Minutes value of clock. Range is 00 to 59
    @HOUR Hours value of clock in 24-hour format. Range is 00 to 23
    @MDAY Current day of month. Range is 01 to 31
    @MON Current month. Range is 01 to 12
    @YEAR Current four-digit year
    @WDAY Numeric day of week. Range is 1 to 7 which corresponds to Sunday through Saturday.
    @YDAY Current day of year. Range is 1 to 366 (or 365 if not a leap year)

    Use your time variable:

    Code:
    $time = @hour & ":" & @MIN
    MsgBox(4096, "time", $time)

  3. #3
    eean's Avatar
    Join Date
    May 2006
    Location
    Kuala Lumpur
    Posts
    559
    Thank Post
    65
    Thanked 52 Times in 37 Posts
    Rep Power
    29
    Quote Originally Posted by My220x View Post
    All I have is:

    Code:
    MsgBox (0, "Time Is", "The time is:" $time)

    Also, IIRC, this should be:
    Code:
     MsgBox (0, "Time Is", "The time is: " & $time)

SHARE:
+ Post New Thread

Similar Threads

  1. kix script not running all the time
    By kubasa in forum Windows
    Replies: 11
    Last Post: 4th March 2008, 10:29 PM
  2. script time stamp help
    By Mike-j in forum Scripts
    Replies: 3
    Last Post: 28th February 2008, 06:22 PM
  3. AutoIt Script Help - Get Last Changed File
    By russdev in forum Scripts
    Replies: 8
    Last Post: 8th August 2007, 05:34 AM
  4. Replies: 4
    Last Post: 15th December 2006, 12:14 PM
  5. Startup script time-out gotcha aargh!!
    By NetworkGeezer in forum Windows
    Replies: 7
    Last Post: 1st June 2006, 05:13 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •