Repository navigation
Expand file tree
/
Copy pathDateTimeNew.cs
More file actions
82 lines (77 loc) · 1.85 KB
/
Copy pathDateTimeNew.cs
File metadata and controls
82 lines (77 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Utility
{
public class DateTimeNew
{
public static DateTime Now
{
get
{
return DateTime.Now;
}
}
/// <summary>
/// 短日期格式(yyyy/MM/dd)
/// </summary>
public static string ShortDate
{
get
{
return Now.ToString("yyyy/MM/dd");
}
}
/// <summary>
/// 长日期格式(yyyy月MM日dd日)
/// </summary>
public static string LongDate
{
get
{
return Now.ToString("yyyy月MM日dd日");
}
}
/// <summary>
/// 日期时间(yyyy/MM/dd HH:mm)
/// </summary>
public static string ShortDateTime
{
get
{
return Now.ToString("yyyy/MM/dd HH:mm");
}
}
/// <summary>
/// 日期时间(yyyy年MM月dd日 HH时mm分)
/// </summary>
public static string LongDateTime
{
get
{
return Now.ToString("yyyy年MM月dd日 HH时mm分");
}
}
/// <summary>
/// 日期时间(yyyy年MM月dd日 HH时mm分)
/// </summary>
public static string LongTime
{
get
{
return Now.ToString("HH时mm分");
}
}
/// <summary>
/// 日期时间(yyyy年MM月dd日 HH时mm分)
/// </summary>
public static string ShortTime
{
get
{
return Now.ToString("HH:mm");
}
}
}
}