date - Convert a get;set string DateEntered from yyyy-MM-dd to MM-dd-yyyy in C#? -
in 1 .cs file have following:
public string dateentered { get; set; }
in .cs file have string grab date.
public string highestdate { { ... return d.dateentered; } }
wondering how convert output yyyy-mm-dd mm-dd-yyyy? scope in used follows:
data.highestdate
thanks in advance.
edit:
another part of code think integral:
var s = this...(i => i.dateentered == datetime.utcnow.tostring("mm-dd-yyyy"));
however changes instances of date format.
you should store dates datetime
variables:
public datetime dateentered { get; set; }
then can render date in consumer application (ui):
public string highestdate { { ... return d.dateentered.tostring("mm-dd-yyyy"); } }
Comments
Post a Comment