How to convert a time to epoch with Expression

I’m sure you guys know this already, but if you change a SQL Tag’s data type from DateTime to INT8 (and remove Metadata formatting), you get the number of ms since the epoch.

For instance,
An Expression Tag with now() set to DateTime will show:
2014-03-21 11:05:10 AM

An Expression Tag with now() set to INT8 will show:
1,395,417,911,332

The same is true if I query Microsoft SQL with a Query Tag, SELECT GETDATE(). Additionally, I get the same value if I query a SQL record in a datetime column with INT8.

All appear to be milliseconds since the epoch. I should be able to use these for any time calculations (deltas) around DST to avoid negatives and +60 minute values. So…I was overcomplicating it again trying to go back and forth from locale’s time and UTC and epoch.

I guess anything that goes “through” Ignition via a Tag hits the Java layer which uses UTC and milliseconds from the epoch.