我有不同日期时间格式的数据,我希望他们将它们转换为相同的日期时间格式
例如,
我当前的列数据是
21-04-2022 14:30:00
02-03-2021 14:30:00
2021-05-02 14:30:00
2022-06-21 14:30:00
我希望我的数据具有相同的日期时间格式。
2022-04-21 14:30:00
2021-03-02 14:30:00
2021-05-02 14:30:00
2022-06-21 14:30:00
我不希望时间发生变化,但问题是日期和时间都在一列中,所以我想要一个正确的解决方案,通过它我可以转换我的数据
我尝试了不同的方法,但没有任何帮助。
For Example
my current column data is
21-04-2022 14:30:00
02-03-2021 14:30:00
2021-05-02 14:30:00
2022-06-21 14:30:00
I want my data is same date time format.
2022-04-21 14:30:00
2021-03-02 14:30:00
2021-05-02 14:30:00
2022-06-21 14:30:00
I don't want changes in time but the thing is both date and time are in one column so i want a proper solution through which i can convert my data
i have tried different methods but nothing is helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您必须将
varchar
的类型更改为datetime
然后使用
INSERT INTO table Values('2022-04-21 14:30:00');
添加日期除了您已输入的数据之外,例如:
注意: 在显示表格的地方添加您的表格名称
First of all you have to change the type of
varchar
todatetime
And then add the date with
INSERT INTO table Values('2022-04-21 14:30:00');
In addition to the data you have already entered, for example :
Note : Where it says table add your table name