从文本fileld的日期选项中提取星期几

编程入门 行业动态 更新时间:2024-10-26 10:27:28
本文介绍了从文本fileld的日期选项中提取星期几的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

计划细分 txt_Return_Date.Text = ds.Tables [CURASCH]。行[0] [RETURN_DATE ] .ToString(); txt_Day.Text = txt_Return_Date.Text 需要获取 txt_Day.Text 来自txt_Return_Date.Text的文本的星期几 星期一 星期二 星期三 星期四 请提供相应的网络参考资料。 /> 我的尝试: 已检查我的代码找到一个无效的例子。 需要一个参考,里面有这个问题的例子

解决方案

使用TryParse或TryParseExact将其转换为DateTime值,并使用 DateTime.DayOfWeek属性(系统) [ ^ ]获取工作日。

Program segment txt_Return_Date.Text = ds.Tables["CURASCH"].Rows[0]["RETURN_DATE"].ToString(); txt_Day.Text = txt_Return_Date.Text Need to get the day of the week for the text filed txt_Day.Text from "txt_Return_Date.Text" Monday Tuesday Wednesday Thursday please provide me with the appropriate web references. What I have tried: Checked my codes to find an example to no avail. Need a reference which has examples on this issue

解决方案

Convert it to a DateTime value using TryParse or TryParseExact, and use the DateTime.DayOfWeek Property (System)[^] To get the week day.

更多推荐

从文本fileld的日期选项中提取星期几

本文发布于:2023-10-28 19:56:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1537621.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本   星期   日期   选项中   fileld

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!