Javascript - Equivalent of .NET DateTime.MaxValue.Ticks
According to article "Azure Storage Table Design Guide: Designing Scalable and Performant Tables"
" https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-design-guide#log-tail-pattern". The below code is used to store the entities using a RowKey that naturally sorts in reverse date/time order by using so the most recent entry is always the first one in the table.
The Equivalent JavaScript code is as below:
" https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-design-guide#log-tail-pattern". The below code is used to store the entities using a RowKey that naturally sorts in reverse date/time order by using so the most recent entry is always the first one in the table.
string invertedTicks = string.Format("{0:D19}", DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks);
The Equivalent JavaScript code is as below:
var currentTimeInMilliseconds=moment().add(-2, 'hours').valueOf() * 10000 + 621355968000000000;
//MaxTime is theDateTime.MaxValue.Ticks
var MaxTime = 3155378975999999999;
var rowKey =(MaxTime - currentTimeInMilliseconds).toString();
Comments
Post a Comment