Alex Rivera | Logout

Convert DateTime to yyyyMMdd int

Asked 2010-02-03T22:27:23.393
10

What is the quickest way to convert a DateTime to a int representation of the format yyyyMMdd.

i.e. 01-Jan-2007 --> 20070101 (as in int)?

Edit
Report

1 Answer

27
int x = date.Year * 10000 + date.Month * 100 + date.Day
answered 2010-02-03T22:30:36.530

Your Answer