Results 1 to 4 of 4

Thread: whenCreated Date Format

  1. #1
    Join Date
    Oct 2005
    Posts
    12

    whenCreated Date Format

    I wanted to calculate the duration and for that I need to convert whenCreated value in vb script. But the problem is I don’t know how to do the same. Can anyone please tell me if it is possible? Also I would like to know how many day has the object been
    created.

    Thanks for all your helps.

  2. #2
    Join Date
    Sep 2004
    Posts
    129

    Re: whenCreated Date Format

    Actually the whenCreated attribute is a kind of data generalized time, hence there is no need of any conversion to display it. What you can do is you can use the DateDiff function to calculate the number of days. For example:

    Set objComputer = GetObject("LDAP://cn=TestCmp,ou=Sales,dc=MyDomain,dc=com")
    dtmCreated = objComputer.whenCreated
    Wscript.echo "Created: " & dtmCreated
    lngDays = DateDiff("d", dtmCreated, Now())
    Wscript.Echo "Days ago: " & lngDays

  3. #3
    Join Date
    Oct 2005
    Posts
    12

    Re: whenCreated Date Format

    Thank you very much for the help Illeana. The whenCreated timestamp ends with .0Z so I thought conversion needed in order to do the math.

  4. #4
    Join Date
    Jul 2004
    Posts
    141

    Re: whenCreated Date Format

    ADSI must convert the value to local time. The only time I use the format with .0Z is when I filter on whenCreated in an ADO search. ADSI Edit displays the value in the usual date/time form, and my VBScript programs do as well. Does someone have more information?

Similar Threads

  1. Using date format in JSP
    By KAMANA in forum Software Development
    Replies: 6
    Last Post: 29-07-2010, 10:32 AM
  2. Problem in date format
    By Vodka in forum Software Development
    Replies: 5
    Last Post: 19-02-2010, 04:38 AM
  3. Insert date format in SQL via ASP
    By Bansi_WADIA in forum Software Development
    Replies: 4
    Last Post: 04-12-2009, 10:56 PM
  4. Changing Date format in Excel
    By Jamaima in forum Windows Software
    Replies: 3
    Last Post: 15-10-2009, 02:06 PM
  5. Changing the date format
    By Uzair in forum Customize Desktop
    Replies: 3
    Last Post: 03-04-2009, 12:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,882,436.27271 seconds with 17 queries