Reputation: 2851
how to convert timestamp string to date in c# for example i need convert 40504 to 2010/11/22 like excel
Upvotes: 2
Views: 2781
Reputation: 4939
edit: sorry, DateTime.FromOADate(double date) iirc -- link to msdn here ...
and to clarify I'm proposing this if your 40504 int is an excel (OA) date that you want to convert ...
Upvotes: 2
Reputation: 6617
You could use this constructor of the DateTime structure. It receives only one parameter as an Int64
that represents the ticks. But a timestamp in ticks is represented by a longer number than the one you exemplified. Consider giving more details on the data/time representation.
Upvotes: 0