C# 获取今天是星期几

1 //获取今天是星期几
2             string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
3             string week = Day[Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d"))].ToString();
4             this.LbWeekday.Content = week;

原文地址:https://www.cnblogs.com/dotnetHui/p/8533677.html

时间: 2024-11-09 10:24:55

C# 获取今天是星期几的相关文章

IOS 获取年月日、星期

#pragma mark - 获取年月日及星期 + (NSString *)stringFromDate { // 添加日期 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = [[NSDateComponents alloc] init]; NSInteger unitFlags = NSYearCalendar

js获取日期时间星期

// js获取日期时间 function getDateTime(){ var dateObj = new Date(); //表示当前系统时间的Date对象 var year = dateObj.getFullYear(); //当前系统时间的完整年份值 var month = dateObj.getMonth()+1; //当前系统时间的月份值 var date = dateObj.getDate(); //当前系统时间的月份中的日 var day = dateObj.getDay(); /

Android获取日期及星期的方法

Calendar calendar=Calendar.getInstance(); SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy年MM月dd日"); String[] str1=new String[]{"Error","日","一","二","三","四","五",&qu

java获取上个星期第一天和最后一天

package com.goldcn.jzgmanageplat.b2b.controller; import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Date;import java.util.GregorianCalendar; import com.goldcn.common.utils.CommonUtils; public class aa { public static void ma

php 获取 今天是星期几

<?php /*判断当天是星期几*/ $weekarray=array("日","一","二","三","四","五","六"); //先定义一个数组 $yi="星期一"; $er="星期二"; $san="星期三"; $si="星期四"; $wu="星期五";

php获取当前是星期几

<?php $weekarray=array("日","一","二","三","四","五","六"); echo "星期".$weekarray[date("w")];

JS获取当前日期、星期、时间

<div id="getdate"></div> <script> function getCurDate(){ var d = new Date(); var week; switch (d.getDay()){ case 1: week="星期一"; break; case 2: week="星期二"; break; case 3: week="星期三"; break; case 4:

javascript 字符串转日期 获取当天是星期几

服务器传回日期字符串 格式如下: 2015-01-20 12:03:12 2015-01-19 19:10:00 2015-01-19 12:00:00 2015-01-19 08:41:00 2015-01-16 12:23:46 要求 判断该日期是星期几 转成如下格式: 首先把字符串转换成日期格式 查了一些方法 下面这个最简单 var str = '2015-01-20 12:03:12'; dateStr = dateStr.replace(/-/g,'/'); var date = ne

jQuery日期获取月和星期

1 <div: id="clock"></div:> 2 <script> 3 function a(clock){ 4 var now =new Date(); 5 var month=now.getMonth()+1; 6 var day=now.getDay(); 7 var s=now.getSeconds(); 8 var arr=new Array("星期日","星期一","星期二&quo