Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert number to time
Message
From
13/01/2007 09:37:44
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
13/01/2007 05:31:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01185341
Message ID:
01185357
Views:
12
Dates and times in Excel are stored as serial numbers of dates.

For example, 6:00 a.m. of today is stored as 39095.25: 39095 days + 1/4 day since the "reference date" used by Excel (31/Dec/1899).

So, I think you should calculate this number, and then give the cell the corresponding date (or time) format.

For a time, if the date is not of interest, you can use zero point something, e.g., 0.25 for 6:00 a.m. (1/4 of a day since midnight).

>hi all,
>i try to convert my table have some fields with numbers to excel sheet (convert number to hours and minuts, my report works, but excel sheet not any help
>
>
>.
>.
>.
>REPORT FORM rpt11 PREVIEW &&it works
>
>***select curbilldata
>
>gcDelimName = ALIAS( ) + '.xls'
>gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
>IF EMPTY(gcDelimFile)
>   CANCEL
>ENDIF
>COPY  TO (gcDelimFile) XL5
>
>
>FUNCTION Sec2Str(tnSeconds, llDays)
>
>LOCAL lcHH, lnTm, lcMM, lcSS, lcTime
>lnTm = tnSeconds
>IF llDays
>   lcDD = TRANSFORM(INT(lnTm / 86400), "99") + " "
>   lnTm = tnSeconds % 86400
>   lcHH = TRANSFORM(INT(lnTm / 3600), "@L 9999")
>ELSE
>   lcDD = ""
>   lcHH = TRANSFORM(INT(lnTm / 3600), "@L 99999")
>ENDIF
>lnTm = lnTm % 3600
>lcMM = TRANSFORM(INT(lnTm / 60), "@L 99")
>lcSS = TRANSFORM(INT(lnTm % 60), "@L 99")
>lcTime = lcDD + lcHH + ":" + lcMM
>*lcTime = lcDD + lcHH + ":" + lcMM + ":" + lcSS
>RETURN lcTime
>
>thanks
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform