Hi,
I am looking to duplicate some functionality in VB Script (as the system I am trying to implement the functionality in, only uses VBScript).
The code is originally coming from C#.NET, looking like this:
==
public string OverallJobNumber { get; set; }
//do lots of other good stuff then
string currentDateYYYYMMDD = PadWithOneZero(DateTime.Now.Year) + PadWithOneZero(DateTime.Now.Month) + PadWithOneZero(DateTime.Now.Day);
OverallJobNumber = currentDateYYYYMMDD + "_" + DateTime.Now.Ticks + "_" + MyRandomGenerator.Next().ToString();
==
The resultant 'OverallJobNumber' is something like this: 20150327_635630451520780747_178211495_ev.pdf
For the moment, it's this part: DateTime.Now.Ticks I am trying to replicate in VB Script.
I have tried to re-create this in 'VB Script', below,
Dim ticks
'ticks = ((TodayNotString * 10000) + 621355968000000000)
'ticks = DateDiff("s", "01/01/1970 00:00:00", Now())
ticks = DateDiff("s", "01/01/0001 00:00:00", Now())
'OverallJobNumber = currentDateYYYYMMDD & "_" & CStr(TodayNotString.Ticks) & "_"
OverallJobNumber = currentDateYYYYMMDD & "_" & ticks & "_"
but I am getting a different string like these (depending on which code, above is commented, or uncommented):
Test Writing to LogFile OverallJobNumber 201504010_6.21355968421042E+17__
Test Writing to LogFile OverallJobNumber 201504013_1428920175__
Test Writing to LogFile OverallJobNumber 201504013_450613958__
Does anyone have an idea how to make VBScript create a Tick thing just like C Sharp can?
It's possibly a mathematics question, but it depends what you know about the C Sharp Ticks ?
Any other ideas?