tags:

views:

12

answers:

0

I use an SQL varchar field to store my datetimes and would like Linq-to-SQL to store DateTime fields using ToString("o").

 [Column(Name = "inserted", DbType = "varchar(30)", CanBeNull = false)]
 public DateTime Inserted { get; set; }

A Linq-to-SQL insert will result in a format of "mm/dd/yyyy HH:mm:ss". I'd like to customise the datetime string format.