构造年 - 月 - 日小时:min:来自编码字符串的秒

时间:2013-11-27 15:37:38

标签: excel excel-vba vba

我在单元格中有以下值07DD0B190C3A00

我知道:

07DD is the year      2013
0B   is the month     November
19   is the date      25th
OC   is the hour      Noon
3A   are the minutes  58

如何将其翻译为2013-11-25 12:58:00

1 个答案:

答案 0 :(得分:4)

假设值在A1中,那么这应该有效:

=HEX2DEC(LEFT(A1,4))&"-"&HEX2DEC(MID(A1,5,2))&"-"&HEX2DEC(MID(A1,7,2))&" "&HEX2DEC(MID(A1,9,2))&":"&HEX2DEC(MID(A1,11,2))&":"&HEX2DEC(MID(A1,13,2))