如何将2013年4月9日8:09:10 PM转换为2013年9月4日(MM-dd-yyyy)。我试着转换,但它取09为日期,04为月。
请帮帮忙
[HttpPost]
public string getdailynote(DateTime selectedDate)
//selectedDate gets date as 04/09/2013 8:09:10 PM
{
string x = selectedDate.ToString("MM-dd-yyy", CultureInfo.InvariantCulture);
string daily;
Dat
下面提到的问题已解决,代码已更改以反映更改。
我想对照存储在我的MySQL数据库中的日期检查当前日期。为了检索当前日期,我使用nist时间服务器,它返回格式为MM-DD-YYYY的日期,在我的数据库中,我的值以“YYYY-MM-DD”格式存储。我想要做的是检查我传递的日期是否等于数据库中的日期,然后执行一些操作。
我使用的代码如下:
// The code originally posted has been changed to reflect changes made and it is now working fine (problem solved) a big thank you t
有没有办法让下面的活动更有效率。
+ (NSMutableArray *)sortArrayOfOrdersByDate:(NSMutableArray *)array{
//create an array of the dates from the Order class
NSMutableArray *dates = [[NSMutableArray alloc] init];
for (Order *order in array)
[dates addObject:[Utility parseDateFromString:order.date f