Azure Table Storage - Milliseconds part of a datetime

593 Views Asked by At

There's any way to save a complete datetime (with the milliseconds part) in a table storage?

I'm using a TableServiceContext to save my entities.

Thanks

1

There are 1 best solutions below

0
On
public class YourEntity : TableEntity
{
    public YourEntity(string partitionName, string id)
    {
        this.PartitionKey = partitionName;
        this.RowKey = id;
    }

    public YourEntity() { }

    private string _date = "";
    public string CustomDate 
    { 
        get
        {
            return _date;
        }
        set
        {
            _date = value;
        }
    }    
}

YourEntity entity = new YourEntity("sample", "1");
entity.CustomDate = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss.ffffff");