如何获取格式为月日期的明天日期(例如:4月3日) [英] how to get tomorrow date with format month date (ex: April 3)
本文介绍了如何获取格式为月日期的明天日期(例如:4月3日)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用明天的日期来代替明天日期,例如4月3日.请给我打电话
I want to displey the tomorrow date with format month date for example April 3. please teel me
推荐答案
NSDate * today = [NSDate date];
NSDate * tomo = [现在addTimeInterval:60 * 60 * 24 * 1];
NSDateFormatter *格式化程序= [[[[NSDateFormatter alloc] init] autorelease];
//设置所需的日期格式
[formatter setDateFormat:@"MMMdd"];
//获取字符串date
NSString * str = [formatter stringFromDate:tomo];
NSDate *today = [NSDate date];
NSDate *tomo = [now addTimeInterval:60*60*24*1];
NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];
// Set the required date format
[formatter setDateFormat:@"MMMdd"];
// Get the string date
NSString* str = [formatter stringFromDate:tomo];
请检查以下以特定日期格式获取明天的代码
Please check below code of getting tomorrow in specific date format
// get tomorrow days with specific date format
Response.Write(DateTime.Now.AddDays(1).ToString("MMMM, dd"));
这篇关于如何获取格式为月日期的明天日期(例如:4月3日)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文