 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
nick
Joined: 24 Aug 2005 Posts: 345 Location: Berlin / Germany
|
Posted: Sat Aug 16, 2008 10:38 am Post subject: Valid timestamp? |
|
|
| Code: | #NoEnv
AHK_Version := "1.0.47.06"
Date := 20081515
If Date Is Not Time
MsgBox, Invalid Timestamp : %Date%
FormatTime, FDate, %Date%, dd.MM.yyy
MsgBox, %FDate%
ExitApp |
| Quote: | ---------------------------
TimeStamp.ahk
---------------------------
15.01.2008
---------------------------
OK
---------------------------
|
Bug or feature? _________________ nick
denick @ http://de.autohotkey.com/forum/ |
|
| Back to top |
|
 |
Peter
Joined: 30 Dec 2005 Posts: 279
|
Posted: Sat Aug 16, 2008 12:10 pm Post subject: |
|
|
I don't see much of a feature in it. I've tested a bit more.
And it seems that Ahk doesn't care about the month number, any number will be valid according to Ahk. On the other hand it checks correct on days, also for special months like February. (And also correct on hours, minutes, sec.) | Code: | #NoEnv
AHK_Version := "1.0.47.06"
Invalid := 0
Loop, 100 {
Month := "0" . (A_index - 1)
StringRight, Month, Month, 2
Day := "10"
; Day := "0" . A_index ; same test w/ days gives correct result
; StringRight, Day, Day, 2
; Month := "10"
Date = 2008%Month%%Day%
tooltip %Date%
If Date Is Not Time
{
Invalid++
InvalidList := InvalidList . A_index . ","
}
}
MsgBox, %Invalid% invalid dates `nInvalidList= `n%InvalidList%
ExitApp |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|