SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Advanced Member
    Join Date
    Mar 2002
    Location
    Earth, USA, New York, Western
    Posts
    759
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Date format, checking the history

    I found this thread and working on modifing the code. Checking the history does help.

    http://www.qaforums.com/cgi-bin/foru...=004123#000000

    I'm using the code

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> [-] testcase TestDateTime() appstate none
    [ ] DATETIME dtStartDate = GetDateTime()
    [ ] DATETIME dtEndDate = AddDateTime(dtStartDate,-90) // add one day
    [ ] print (&quot;Start Date: {FormatDateTime(dtStartDate,&quot;mm-dd-yyyy hh:mm:ss&quot}&quot
    [ ] print (&quot;End Date: {FormatDateTime(dtEndDate,&quot;mm-dd-yyyy hh:mm:ss&quot}&quot</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I will remove the time and change the year to 1 or 0 for the mainframe.

    Thanks.
    Bruce

  2. #2
    Advanced Member
    Join Date
    Mar 2002
    Location
    Earth, USA, New York, Western
    Posts
    759
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Date format, checking the history

    I need to go back 90 days and format the date as CYYMMDD. To get the C "century" I need to see just the first number of the year. If it is a 2 I need to place a 1 at the C mark and if it is a 1 I need to place a 0 at the C mark...... Wait..... I'm think..... for this I can always use a 1......... I just need to format like ""1"+YYMMDD"...... thank you for listening.

    Bruce.

  3. #3
    Advanced Member
    Join Date
    Mar 2002
    Location
    Earth, USA, New York, Western
    Posts
    759
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Date format, checking the history

    I do need a little help....
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> [-] testcase TestDateTime() appstate none
    [ ] DATETIME dtNowDate = GetDateTime()
    [ ] DATETIME dtFromDate = AddDateTime(dtNowDate,-90) // back 90 days
    [ ] STRING sFromDate
    [ ] print (&quot;Start Date: {FormatDateTime(dtNowDate,&quot;mm-dd-yyyy&quot}&quot
    [ ] print (&quot;End Date: {FormatDateTime(dtFromDate,&quot;1yymmdd&quot}&quot
    [ ] sFromDate = {FormatDateTime(dtFromDate,&quot;1yymmdd&quot}
    [ ] Print ({sFromDate})</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">the line
    sFromDate = {FormatDateTime(dtFromDate,"1yymmdd")}

    Does not compile. Type Mismatch - Expecting a STRING. This is good I want sFromDate to match what is in the print statement, [ ] print ("End Date: {FormatDateTime(dtFromDate,"1yymmdd")}").

    Thanks,
    Bruce.

  4. #4
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Date format, checking the history

    Take off the curly braces surrounding the {FormatDateTime(dtFromDate,"1yymmdd")}
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  5. #5
    Advanced Member
    Join Date
    Mar 2002
    Location
    Earth, USA, New York, Western
    Posts
    759
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Date format, checking the history

    THANKS, TonyM.
    It works....

    Bruce.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:47 PM.

Copyright BetaSoft Inc.