Skip to content

Commit bc7ce51

Browse files
committed
Merge pull request #58 from watson-developer-cloud/feature-epochtime-utility
* Minor feature for Epoch UTC timing in utility
2 parents 5079d09 + 40fd322 commit bc7ce51

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Config.json.enc

0 Bytes
Binary file not shown.

Scripts/Utilities/Utility.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,15 @@ public static string StripString(string s)
274274

275275
}
276276

277+
/// <summary>
278+
/// Gets the EPOCH time in UTC time zome
279+
/// </summary>
280+
/// <returns>Double EPOCH in UTC</returns>
281+
public static double GetEpochUTC()
282+
{
283+
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
284+
return (DateTime.UtcNow - epoch).TotalMilliseconds;
285+
}
277286

278287

279288
/// <summary>

0 commit comments

Comments
 (0)