0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Excel の 5digit を日付に戻す方法

Posted at

エクセルファイルで日付が 5 digit で表示された時に、日付を計算する方法です。
date_apr26.png

#! /usr/bin/python
#
from dateutil.parser import parse
from datetime import timedelta
#
# ------------------------------------------------------------------
def convert_proc(tt):
	pp = parse("1900-1-1") + timedelta(days = tt - 2)
	return pp
# ------------------------------------------------------------------
tts = [43883,43915,43916]

for tt in tts:
	pp = convert_proc(tt)
	print(tt,pp)
# ------------------------------------------------------------------

実行結果

$ ./convert.py
43883 2020-02-22 00:00:00
43915 2020-03-25 00:00:00
43916 2020-03-26 00:00:00
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?