CheeseBiscuit Posted July 30, 2013 Share Posted July 30, 2013 For the life of me I can't seem to get the current date + time + log.txt to work when I try to create a file.. I just want the created file to be named "mm/dd/yyyy-hr:mm:seconds-log.txt This is my code: $_filename = @MON & "/" & @MDAY & "/" & @YEAR & "-" & @HOUR & ":" & @MIN & ":" & @SEC & "-log.txt" ;MsgBox(1, "date", $_filename) $_file = FileOpen($_filename, 2) If $_file == -1 Then MsgBox(4096, "Critical Error", "Couldn't Create Log File!") exit Endif I first tried _Now() and _NowDate() and _NowTime(), They all set the variable to the date and time + log.txt but when I try to create the file it throws the error msg EVERYTIME!!! Where is my error? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 30, 2013 Moderators Share Posted July 30, 2013 Eh, you can't use "/" in a file name "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
CheeseBiscuit Posted July 30, 2013 Author Share Posted July 30, 2013 *facedesk* I knew it was something stupid.. Completely forgot, thanks Link to comment Share on other sites More sharing options...
MarkRobbins Posted July 30, 2013 Share Posted July 30, 2013 The problem is the colons, but Im sure you got that by now. 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