Skip to main content

MTS returns 13:37:42, but with sending data to SQL, multiple timestamps have the same value.

Is there a way to get miliseconds?  We are transmitting multiple records and many would have the same "42" second value.

Our best solution is to get the MTS value and add the decimal portion of U2 internal time to it.  

For example, if raw time is 49062.2004, MTS retruns 13:37:42. before sending to SQL, we would change it to 13:37:42.2004

SQL date field would get "2025-07-25 13:37:42.2004" which it may not like.

Any suggestions?

MTS returns 13:37:42, but with sending data to SQL, multiple timestamps have the same value.

Is there a way to get miliseconds?  We are transmitting multiple records and many would have the same "42" second value.

Our best solution is to get the MTS value and add the decimal portion of U2 internal time to it.  

For example, if raw time is 49062.2004, MTS retruns 13:37:42. before sending to SQL, we would change it to 13:37:42.2004

SQL date field would get "2025-07-25 13:37:42.2004" which it may not like.

Any suggestions?

Nelson,

See the BASIC $OPTIONS statement:

Regards

JJ


MTS returns 13:37:42, but with sending data to SQL, multiple timestamps have the same value.

Is there a way to get miliseconds?  We are transmitting multiple records and many would have the same "42" second value.

Our best solution is to get the MTS value and add the decimal portion of U2 internal time to it.  

For example, if raw time is 49062.2004, MTS retruns 13:37:42. before sending to SQL, we would change it to 13:37:42.2004

SQL date field would get "2025-07-25 13:37:42.2004" which it may not like.

Any suggestions?

Hi Nelson,

You don't tell us which version of UV or which OS or which implementation of SQL you are using. 

There are new NOW() function & DT oconvs in UV11.4 ? and up, supported on Linux & Solaris platforms that do what you want.

You may need to change your SQL column to DATETIME2 or whichever date/time.ms type your SQL implementation supports to retain the ms portion of the timestamp.