![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 1
|
I am gathering date and time data in XML. Then dropping the date and time information into excel so my co-workers can easily manipulate the data. However when I drop the date and time information into excel the seconds is truncated. For example 05122002 03:12:32 becomes 5/12/2002 3:12 NO Seconds? Is there an after market formating patch that enables Excel to deal with seconds?
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
I think that is the default format for the date and time you are entering. Did you try and format the cells to include seconds?
The full time should show seconds in your formula bar. If the seconds are correct in the formula bar then you can show them by formatting the cell correctly. Tom |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
In this case you would need to Custom Format the entry as m/dd/yyyy h:mm:ss |
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: May 2002
Location: Tennessee, USA
Posts: 72
|
I agree that the correct formatting should solve your problem. However, I recently encountered a similar situation where I needed to know how many days (an exact whole number) it had been since the workbook just opened had been updated (modified). I just simply truncated the minutes and seconds off of the last modification date & time and then subtracted that date from today's date. This gave me a whole number of days since the last mod. This way I avoided fractions of days.
[ This Message was edited by: WayneTN on 2002-05-13 09:06 ] |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
The date format shows composite date and time. The days only part can be extracted using the INT function ... =INT(A1-B1) ... will give you just the whole days and drop the fractional time element. If you wanted to pick up the number of full days and fractional part, the hour, minutes and seconds also, you can use the following formula: =INT(A1-B1)&"Days and "&TEXT(MOD((A1-B1),1),"[h]:mm:ss")
__________________
Regards! Yogi Anand, D.Eng, P.E. Energy Efficient Building Network LLC www.energyefficientbuild.com |
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: May 2002
Location: Tennessee, USA
Posts: 72
|
Thanks for the explanation. I must correct some wording I used above, however. Upon further review, I didn't technically "truncate" the date/time, I rounded down the LastMod date/time to give me the equivalent of a whole day. The exact code that I used, shown below, was adapted from a related, 4/15/02 post by Ivan Moala (thanks Ivan). :->
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|