Millisecond (millisecond)
Description
Returns the duration representation of 1 millisecond, or the milliseconds corresponding to a given timestamp. Optionally, you can check it in a time zone different than yours.
How does it work in the search window?
Select Create column in the search window toolbar, then select the Millisecond operation.
This operation can be applied with no arguments. In this case, you will get the duration representation of 1 millisecond (duration data type, 1).
If you add the Timestamp argument, you will get the milliseconds considering your current timezone. Optionally, you can specify a different time zone adding the Time zone argument to see the milliseconds in the specified time zone.Â
Argument | Data type | Description |
---|---|---|
Timestamp mandatory | timestamp | You can either select a column with that data type or introduce it manually. In case you want to introduce it, note that this value should be a date: Year-Month_Day Hour:Minute:Second.Millisecond (yyyy-MM-dd HH:mm:ss.SSS) |
Time zone | string | You need a valid string format the app can recognize so it returns meaningful results. If you leave the field empty or introduce a value the app cannot recognize, the default Time Zone is UTC. You can use one of the following methods:
Be aware that some of the codes coincide, as CST could mean Central Standard Time or China Standard Time. In that case, it would be advisable to avoid using codes and introduce any of the other formats mentioned. |
The data type of the new column values will be integer with no symbol representation and the values shown will be 0-999. Since the count starts at 0, note that the result will be the number of milliseconds - 1 (for example, if the number of milliseconds is 200, you will get 199).
Be aware that timestamps taking place during summer will be affected in the time zones in which they set the clock forward during summer. For example, Europe/Madrid (CET-Central European Time), which is UTC+1, becomes UTC+2 during summertime and thus timestamps in August will be affected when using that time zone. Be also aware that summertime differs between the Northern and Southern Hemispheres.
Example
In the demo.ecommerce.data
 table, we want to create a column showing the milliseconds of the dates in our eventdate column. To do it, we will create a new column using the Millisecond operation.
The arguments needed to create the new column are:
Timestamp - eventdate column
Click Create column and you will see the following result:
How does it work in LINQ?
Use the operator select
... as
... and add the operation syntax to create the new column. These are the valid formats for the Millisecond operation:
millisecond()
→ Use this expression to get the representation of one millisecond in duration data type (1).millisecond(timestamp)
 → Use this expression to get the milliseconds corresponding to the given timestamps, according to your current time zone.millisecond(timestamp, timezone_string)
 →  Use this expression to get the milliseconds corresponding to the given timestamps, according to the specified time zone.
Example
You can copy the following LINQ script and try the above example on the demo.ecommerce.data
table.
from demo.ecommerce.data
select millisecond(eventdate) as eventdates_milliseconds