Jump to content

Best Way To Convert Date From String To Date Value

Recommended Posts

Hey, what's the best way to convert lets say: 20050831095539 to 2005/08/31 09:55:39. I used the code below but it looks ugly ;p Tnx

#include <string.au3>
        $strModified = 20050831095539
        $strModified = _StringInsert($strModified, "/", 4)
        $strModified = _StringInsert($strModified, "/", 7)
        $strModified = _StringInsert($strModified, " ", 10)
        $strModified = _StringInsert($strModified, ":", 13)
        $strModified = _StringInsert($strModified, ":", 16)

My little company: Evotec (PL version: Evotec)

Link to post
Share on other sites

$strModified = 20050831095539
$strModified = StringMid($strModified, 1, 4) & "/" & StringMid($strModified,5,2) & "/" & StringMid($strModified,8,2)

Edit: didn't finish it but you get the idea

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs


Don't argue with an idiot; people watching may not be able to tell the difference.


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...