We have a custom date field for our items. I am working on a custom report on the data, I need to know how to pull the data from the custom field, the data I see is '635288148000000000'
Thanks,
David Williamson
Custom Date Fields
Moderator: SourceGear
Re: Custom Date Fields
What are you using to pull the data?
The Vault Pro API?
The Vault Pro API?
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
Re: Custom Date Fields
From a view in the database.
Re: Custom Date Fields
Custom field dates are stored in the database as .NET UTC ticks. For example to convert the database value to a date in C# you would first convert the string to a long, then use that value to create a DateTime object:
Code: Select all
//get the stringTicks from the database
//convert the string to a long
long longTicks = long.Parse(stringTicks);
//Create a UTC date time from the ticks
DateTime date = new DateTime(longTicks, DateTimeKind.Utc);
//or if you want a local date
DateTime date = new DateTime(longTicks, DateTimeKind.Utc).ToLocalTime();
Mary Jo Skrobul
SourceGear
SourceGear