日期转换问题 [英] DATETIME CONVERSION PROBLEM

查看:123
本文介绍了日期转换问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DateTime dt1 = Convert.ToDateTime(txtBxDay.Text.ToString());

DateTime dt2 = Convert.ToDateTime(txtBxTime.Text);







txtByDay.Text是Date数据类型,我无法转换为datetime。时间相同...

是否有任何格式来获取日期并转换为DATETIME和获取时间(time数据类型)并转换为DATETIME并添加两个值作为DATETIME ....

DateTime dt1 = Convert.ToDateTime(txtBxDay.Text.ToString());
DateTime dt2 = Convert.ToDateTime(txtBxTime.Text);



txtByDay.Text is Date datatype and I couldn't convert to datetime. Same case for time...
Is there any format to fetch date and convert to DATETIME and fetch time(time datatype) and convert to DATETIME and adding two values as DATETIME....

推荐答案

我认为数据格式不正确。当您隐藏日期时间意味着格式为(MM / dd / yyyy)时,您不能使用Datetime数据类型
I think the dat format is incorrect .When you covert Datetime mean the format is(MM/dd/yyyy) Othewise you can not use Datetime datatype


这篇关于日期转换问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆