将日期转换为正确的格式 [英] converting dates to correct format
问题描述
我有一个数据集,其中一些日期采用英国格式,而其他日期采用美国格式
I have a data set were some of the dates in UK format and others are in US Format
6/28/2019 07/01/2019
6/28/2019 07/01/2019
6/28/2019 07/01/2019
6/28/2019 07/01/2019
6/28/2019 07/01/2019
将它们全部转换为标准英国格式的最佳方法是什么
what would be the best way to convert them all into the standard UK format
推荐答案
在没有看到您的数据的情况下,我相信您的所有日期实际上都是相同的格式,即mm/dd/yyyy
.我还没有看到任何故意将两种格式混合在一起的数据集.在您的英国版本中,某些日期恰好是合法日期,例如:7-1-2019既可以是1月7日,也很可能是7月1日.
Without seeing your data, I do believe all your dates are in the same format actually, mm/dd/yyyy
. I have not seen any dataset that deliberately would mix two formats together. Some of the dates just happen to be legal dates in your UK version, e.g.: 7-1-2019 can be both 7th of january but most likely is meant to be 1st of july.
快速转换这些日期的最简单方法之一是:
One of the easiest way to quickly convert these dates is to:
- 突出显示日期所在的列.
- 从数据功能区中,选择文本到列"
- 选择定界",然后取消选择所有定界符
- 单击下一步,然后在列数据格式"下选择
Date
格式MYD
- Hightlight the column the dates are in.
- From the Data Ribbon, Choose "Text to Columns"
- Choose "Delimited", and unselect all delimiters
- Click next and under Column data format choose
Date
formatMYD
这篇关于将日期转换为正确的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!