Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Seconds missing from time/date properties

Hi, I am using scripting to get the time and date off some pictures.
I am having a problem the date/time properties missing the seconds
component. Formation the data as hh:mm:ss does not help.

Using windows 7, excel 2010


Name Size Item type Date modified
P1030001.JPG 5.31 MB JPG File 10/11/2010 8:11

Date created Date accessed Date taken
10/11/2010 8:11 22/10/2010 12:00 AM 11/10/2010 8:11 AM


Sub Extract_file_details()
'http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_lunl.mspx?
mfr=true
Const oNum = 30
Dim iFound As Integer
Dim arrHeaders(oNum) 'max 279 cols
Dim i As Integer
Dim objShell As Object
Dim objFolder As Object
Dim strFileName As Variant
Dim x As Integer
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("F:\DCIM\103_PANA") 'change to
suite
For i = 0 To oNum '279
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Cells(1, i + 1) = arrHeaders(i)
Next

x = 1

For Each strFileName In objFolder.Items
x = x + 1
Cells(x, 1).Select
For i = 0 To oNum '266 best 279
Cells(x, i + 1).Value = objFolder.GetDetailsOf(strFileName, i)
Next
Next

End Sub

Thank you for any help in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Seconds missing from time/date properties

On 10/22/2010 03:25 AM, Greg wrote:
Hi, I am using scripting to get the time and date off some pictures.
I am having a problem the date/time properties missing the seconds
component. Formation the data as hh:mm:ss does not help.

Using windows 7, excel 2010


Will this work in xl2010?

http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

Get Quick Access to File Properties by Using the VBA File Functions

You can quickly obtain file properties such as the created date, the
last modified date, or the number of bytes in a file by using the VBA
FileDateTime and FileLen functions, for example:

Public Sub TestFileProperties()
' Purpose: Demonstrates the use of the VBA FileDateTime
' and FileLen functions.
' Create the following file in your C:\ drive.
Const FILE_PATH As String = "C:\SampleFile.txt"
On Error GoTo TestFileProperties_Err
' List the created/modified date and the number of bytes
' for the file.
MsgBox Prompt:="'" & FILE_PATH & "' was created or last " & _
"modified on " & FileDateTime(pathname:=FILE_PATH) & "."
MsgBox Prompt:="'" & FILE_PATH & "' contains " & _
FileLen(pathname:=FILE_PATH) & " bytes."
TestFileProperties_End:
Exit Sub
TestFileProperties_Err:
Select Case Err.Number
Case 53 ' File not found.
MsgBox Prompt:="Can't find file '" & FILE_PATH & "'. " & _
"Check the file path and try again."
Case Else
MsgBox "Error number: " & Err.Number & vbCrLf & _
"Description: " & Err.Description
End Select
Resume TestFileProperties_End
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Seconds missing from time/date properties

On Oct 22, 10:35*pm, MikeS wrote:
On 10/22/2010 03:25 AM, Greg wrote:

Hi, I am using scripting to get the time and date off some pictures.
I am having a problem the date/time properties missing the seconds
component. *Formation the data as hh:mm:ss does not help.


Using windows 7, excel 2010


Will this work in xl2010?

http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

Get Quick Access to File Properties by Using the VBA File Functions

You can quickly obtain file properties such as the created date, the
last modified date, or the number of bytes in a file by using the VBA
FileDateTime and FileLen functions, for example:

Public Sub TestFileProperties()
* * *' Purpose: Demonstrates the use of the VBA FileDateTime
* * *' and FileLen functions.
* * *' Create the following file in your C:\ drive.
* * *Const FILE_PATH As String = "C:\SampleFile.txt"
* * *On Error GoTo TestFileProperties_Err
* * *' List the created/modified date and the number of bytes
* * *' for the file.
* * *MsgBox Prompt:="'" & FILE_PATH & "' was created or last " & _
* * * * *"modified on " & FileDateTime(pathname:=FILE_PATH) & "."
* * *MsgBox Prompt:="'" & FILE_PATH & "' contains " & _
* * * * *FileLen(pathname:=FILE_PATH) & " bytes."
TestFileProperties_End:
* * *Exit Sub
TestFileProperties_Err:
* * *Select Case Err.Number
* * * * *Case 53 * * ' File not found.
* * * * * * *MsgBox Prompt:="Can't find file '" & FILE_PATH & "'. " & _
* * * * * * * * *"Check the file path and try again."
* * * * *Case Else
* * * * * * *MsgBox "Error number: " & Err.Number & vbCrLf & _
* * * * * * * * *"Description: " & Err.Description
* * *End Select
* * *Resume TestFileProperties_End
End Sub


Hi,

Thank you yes it does work, however, I need to have all three in
hh:mm:ss format.
Date created Date accessed
Date taken
10/11/2010 8:11:xx 22/10/2010 12:00:xx AM
11/10/2010 8:11:xx AM

Unfortunately there is no VB file property for datetaken.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Seconds to Date - Time Field terminal euphoria Excel Worksheet Functions 3 April 2nd 23 08:55 PM
Month:Date:Time:Seconds Ranjit kurian Excel Programming 2 May 6th 08 09:01 PM
How to convert date/time to seconds [email protected] Excel Worksheet Functions 2 August 19th 06 01:23 AM
Need help: convert seconds to date and time misty1 Excel Discussion (Misc queries) 2 November 26th 05 04:12 AM
How do i convert a number of seconds to a date/time? Margo Excel Worksheet Functions 2 January 5th 05 12:09 AM


All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"