Nikesh Posted July 4, 2009 Share Posted July 4, 2009 Is there any function available to convert or format date in following format. yyyy-mm-dd hh:mm:ss Link to comment Share on other sites More sharing options...
Andreik Posted July 4, 2009 Share Posted July 4, 2009 Is there any function available to convert or format date in following format.yyyy-mm-dd hh:mm:ssFrom what format? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Nikesh Posted July 4, 2009 Author Share Posted July 4, 2009 From what format?From 'mm/dd/yyyy hh:mm:ss' to 'yyyy-mm-dd hh:mm:ss' Link to comment Share on other sites More sharing options...
Andreik Posted July 4, 2009 Share Posted July 4, 2009 From 'mm/dd/yyyy hh:mm:ss' to 'yyyy-mm-dd hh:mm:ss'An example but maybe you can do this with Date fucntions. ;~ 'mm/dd/yyyy hh:mm:ss' to 'yyyy-mm-dd hh:mm:ss' $TEST = "06/04/2009 01:45:37" Func FormatDate($DATE) $SPLIT = StringSplit($DATE," ") $YYYY = StringRight($SPLIT[1],4) $MM = StringLeft($SPLIT[1],2) $DD = StringMid($SPLIT[1],4,2) Return $YYYY & "-" & $MM & "-" & $DD & " " & $SPLIT[2] EndFunc MsgBox(0,"",FormatDate($TEST)) When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Nikesh Posted July 4, 2009 Author Share Posted July 4, 2009 An example but maybe you can do this with Date fucntions. ;~ 'mm/dd/yyyy hh:mm:ss' to 'yyyy-mm-dd hh:mm:ss' $TEST = "06/04/2009 01:45:37" Func FormatDate($DATE) $SPLIT = StringSplit($DATE," ") $YYYY = StringRight($SPLIT[1],4) $MM = StringLeft($SPLIT[1],2) $DD = StringMid($SPLIT[1],4,2) Return $YYYY & "-" & $MM & "-" & $DD & " " & $SPLIT[2] EndFunc MsgBox(0,"",FormatDate($TEST)) This works for me. Many thanks to you Link to comment Share on other sites More sharing options...
weaponx Posted July 4, 2009 Share Posted July 4, 2009 ;Convert MM/DD/YYYY HH:MM:SS to YYYY/MM/DD HH:MM:SS $original = "04/30/1980 01:02:03" $new = StringRegExpReplace($original, "\A(\d*)/(\d*)/(\d*)","$3/$1/$2") Link to comment Share on other sites More sharing options...
GreenCan Posted July 4, 2009 Share Posted July 4, 2009 Look at this topic,the udf DateCalc.au3 will help you with thishttp://www.autoitscript.com/forum/index.ph...ost&p=96173GreenCan Contributions CheckUpdate - SelfUpdating script ------- Self updating script Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple MsgBox with CountDown ------------------- MsgBox with visual countdown Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV) USB Drive Tools ------------------------------ Tool to help you with your USB drive management Input Period udf ------------------------------ GUI for a period input Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette Excel Chart UDF ----------------------------- Collaboration project with water GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm TaskListAllDetailed --------------------------- List All Scheduled Tasks Computer Info --------------------------------- A collection of information for helpdesk Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only) Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane Oracle SQL Report Generator ------------- Oracle Report generator using SQL SQLite Report Generator ------------------- SQLite Report generator using SQL SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access Animated animals ----------------------------- Fun: Moving animated objects Perforated image in GUI --------------------- Fun: Perforate your image with image objects UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool Visual Image effect (GUI) -------------------- Visually apply effects on an image Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now