Coverage for pyguymer3/convert_spreadsheet_to_unix.py: 50%

2 statements  

« prev     ^ index     » next       coverage.py v7.9.2, created at 2025-07-08 18:47 +0000

1#!/usr/bin/env python3 

2 

3# Define function ... 

4def convert_spreadsheet_to_unix( 

5 val, 

6 /, 

7): 

8 """Convert an Excel spreadsheet date to an UNIX timestamp 

9 

10 This function converts an Excel spreadsheet date (which is an integer) to an 

11 UNIX timestamp (which is also an integer). 

12 

13 Parameters 

14 ---------- 

15 val : int 

16 the Excel spreadsheet date 

17 

18 Returns 

19 ------- 

20 ans : int 

21 the UNIX timestamp 

22 

23 Notes 

24 ----- 

25 Copyright 2017 Thomas Guymer [1]_ 

26 

27 References 

28 ---------- 

29 .. [1] PyGuymer3, https://github.com/Guymer/PyGuymer3 

30 """ 

31 

32 # Return answer .. 

33 return 86400 * (val - 25569)