Skip to content

Instantly share code, notes, and snippets.

@TomoG29
Created February 15, 2019 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomoG29/26e28859d118404d07c3567d67276914 to your computer and use it in GitHub Desktop.
Save TomoG29/26e28859d118404d07c3567d67276914 to your computer and use it in GitHub Desktop.
private void TimeNow()
{
DateTime now = DateTime.Now;
int year = now.Year;
//年
int month = now.Month;
//月
int day = now.Day;
//日
int hour = now.Hour;
//時
int minute = now.Minute;
//分
int second = now.Second;
//秒
int milisecond = now.Millisecond;
//ミリ秒
DayOfWeek dayOfWeek = now.DayOfWeek;
//曜日
//日曜日 = 0 ~ 土曜日 = 6
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment