I have a VBScript that writes a dateTimne to a file.
Option Explicit
Dim fso, path, file, recentDate, recentFile, objFileHandle
Set fso = CreateObject("Scripting.FileSystemObject")
Set recentFile = Nothing
For Each file in fso.GetFolder("\\path\folder").Files
If (recentFile is Nothing) Then
Set recentFile = file
ElseIf (file.DateLastModified < recentFile.DateLastModified) Then
Set recentFile = file
End If
Next
Set objFileHandle = fso.OpenTextFile("\\path\folder\DateTime.Txt", 2, "True")
objFileHandle.Write(FormatDateTime(recentFile.DateLastModified) )
objFileHandle.Close
When i run it manually on my server it gives me a US format of mm/dd/yyyy hh:mm:ss AM eg 11/14/2013 9:20:56 AM.
When i run it on my Laptop it gives me back the UK format i actually want - dd/mm/yyyy hh:mm:ss AM eg 14/11/2013 9:20:56 AM.
Any ideas whats going on here?
"True"is onlyTrueby accident (because any non-empty string evaluates toTrue-"False"would work just as well). Use the actual Boolean, not a string. - Tomalak