Guest Muslica Posted May 19, 2004 Share Posted May 19, 2004 Hi ! Id like to create the date of yesterday. I thank, I use the $yesterday=@yday-1 formula, but I cant convert to date this format ! M. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 19, 2004 Developers Share Posted May 19, 2004 Hi !Id like to create the date of yesterday. I thank, I use the $yesterday=@yday-1 formula, but I cant convert to date this format ! M. were did i see this before today ???? #16693 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
herworth Posted May 19, 2004 Share Posted May 19, 2004 How about: $yesterday = @MDAY-1 & "/" & @MON & "/" & @YEAR If you want the month in figures you need something like this expandcollapse popup#include - once Func MonthName( $MonNum, $Format,$Case ) ; $Format- 1 = Jan, 0 = January ; $Case - 1 = January (Jan), 0 = JANUARY (JAN) Local $Month[13] $msg = "You need to enter a month number" & @CRLF & "and 0 or 1 for the format and case" $Month[1] = "January" $Month[2] = "February" $Month[3] = "March" $Month[4] = "April" $Month[5] = "May" $Month[6] = "June" $Month[7] = "July" $Month[8] = "August" $Month[9] = "September" $Month[10] = "October" $Month[11] = "November" $Month[12] = "December" If StringisDigit($MonNum) And $MonNum < 13 And StringisDigit($Format) And _ StringisDigit($Case) Then Select Case $Format = 0 Select Case $Case = 0 Return StringUpper($Month[$MonNum]) Case $Case = 1 Return $Month[$MonNum] Case Else SetError( 1 ) MsgBox(0,"Error",$msg) exit EndSelect Case $Format = 1 Select Case $Case = 0 Return StringUpper(StringLeft( $Month[$MonNum], 3 )) Case $Case = 1 Return StringLeft( $Month[$MonNum], 3 ) Case Else SetError( 1 ) MsgBox(0,"Error",$msg) exit EndSelect Case Else SetError( 1 ) MsgBox(0,"Error",$msg) exit EndSelect Else SetError( 1 ) MsgBox(0,"Error",$msg) exit EndIf EndFunc All the best. [u][font="Arial"]Pete[/font][/u] Link to comment Share on other sites More sharing options...
scriptkitty Posted May 19, 2004 Share Posted May 19, 2004 Local $Month[13] $msg = "You need to enter a month number" & @CRLF & "and 0 or 1 for the format and case" $Month[1] = "January" $Month[2] = "February" $Month[3] = "March" $Month[4] = "April" $Month[5] = "May" $Month[6] = "June" $Month[7] = "July" $Month[8] = "August" $Month[9] = "September" $Month[10] = "October" $Month[11] = "November" $Month[12] = "December" After you know Arrays, you can condence the above part of the code like this: $Month=StringSplit("January,February,March,April,May,June,July,August,September,October,November,December",",") $msg = "You need to enter a month number" & @CRLF & "and 0 or 1 for the format and case" Great showing of what the array contains for the example. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Guest Muslica Posted May 20, 2004 Share Posted May 20, 2004 Thank you ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now