如何将Excel中的日期转换为ISO 8601格式 [英] How to convert a date in Excel to ISO 8601 format

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

问题描述

我正在尝试将YYYY-MM-DD中的日期格式(例如2014-09-01)另存为CSV文件,但是当我这样做时,格式会恢复为M / D / YYYY格式。



我尝试在Excel中将日期转换为字符串,但是每次打开CSV文件时,它都会恢复为M / D / YYYY格式。我需要将ISO8601日期格式保存在CSV文件中。

解决方案

基本功能是:

  = TEXT(A1, yyyy-mm-ddThh:MM:ss)

使用此选项将Excel日期列转换为单独的ISO8601日期列。接下来,将ISO  8601列复制到原件上(特殊粘贴:仅粘贴值)。
删除计算出的ISO8601列,这些列现在已包含垃圾,因为Excel在ISO 8601日期处发生错误。



您现在具有转换后的CSV或TSV没什么。只需另存为原始格式,然后忽略愚蠢的Excel关于它不是其本机文件格式的抱怨,以及如何通过另存为CSV文件以某种方式丢掉,并尽量不要考虑微软被盗的时间那个愚蠢的对话框。


I am trying to save a date format in YYYY-MM-DD, for example, 2014-09-01 as a CSV file, but the format reverts back to the M/D/YYYY format when I do.

I tried converting the date as a string in Excel, but every time I open up the CSV file, it's back to the M/D/YYYY format. I need the ISO 8601 date format to be saved in a CSV file. How do I go about doing so?

解决方案

The basic function is:

=TEXT(A1,"yyyy-mm-ddThh:MM:ss")

Use this to convert your Excel date columns to separate ISO 8601 date columns. Next, copy the ISO 8601 columns onto the originals (paste special: paste values only). Delete the calculated ISO 8601 columns which now have garbage in them because Excel sucks at ISO 8601 dates.

You now have a transformed CSV or TSV or whatnot. Just save as the original format and ignore the stupid Excel whining about it not being its native file format and how you are going to "lose out" somehow by saving as CSV file and try not to think about the hours of your life Microsoft has stolen with that dumb dialog.

这篇关于如何将Excel中的日期转换为ISO 8601格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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