Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2007
    Location
    Tampon, Reunion island
    Posts
    191

    Star How to get date ?

    Hello Indigorose forums ! I have a another question for you :
    How to get the date in AMS ?

    Exemple :

    date=System.Getdate()

    if date==1 then
    Dialog.Message("Today is", "Monday");
    end

    Thank you in advance !

  2. #2
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282
    Code:
    dow = System.GetDate(DATE_FMT_DAYOFWEEK);
    
    if dow == "2" then
    	today = "Monday"
    end
    
    Dialog.Message("Notice", "Today is " .. today, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    On my system anyway...

  3. #3
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    or simply

    Code:
    local dow = os.date("Today is %A")
    Dialog.Message("Notice", dow)
    Dermot

    I am so out of here

  4. #4
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    Or ...

    Assuming you use the European Date Format (Reunion Island is French heritage, yeh?) ... then concatenate Dermot's example with DATE_FMT_EUROPE

    eg.

    Code:
    local day = os.date("%A");
    date = System.GetDate(DATE_FMT_EUROPE);
    Dialog.Message("Date Function", day .. "\r\n" .. date);

  5. #5
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    Or, you could even use AMSWave's Script plugin. Download from:
    AMSWaves Script Plugin

    View his original Post for this plugin at:
    http://www.indigorose.com/forums/sho...d.php?p=128185

    Use this code with the plugin:
    Code:
    code =[[result = Date() + Time()]]
    Script.AddCode(code, Script_InternalCode);
    date = Script.GetResultAsDate("result");
    Dialog.Message("Date & Time", Script.FormatDate(date, "Date: %yyyy.%mm.%dd\r\nTime: %hh:%ii:%ss"))
    Last edited by mystica; 08-17-2009 at 07:59 AM.

  6. #6
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Quote Originally Posted by mystica View Post
    Or ...

    Assuming you use the European Date Format (Reunion Island is French heritage, yeh?) ... then concatenate Dermot's example with DATE_FMT_EUROPE

    eg.

    Code:
    local day = os.date("%A");
    date = System.GetDate(DATE_FMT_EUROPE);
    Dialog.Message("Date Function", day .. "\r\n" .. date);

    No need for a separate action.
    Code:
    local dow = os.date("Today is %A %d/%m/%Y")
    Dialog.Message("Notice", dow)
    Dermot

    I am so out of here

  7. #7
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    cool ... thanx for that, Dermot

Tags for this Thread

Posting Permissions

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