Sign in to follow this  
Followers 0
MadBoy

Best Way To Convert Date From String To Date Value

3 posts in this topic

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)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$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.

 

Share this post


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

Yeap thx :think:

My little company: Evotec (PL version: Evotec)

Share this post


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
Sign in to follow this  
Followers 0