Jump to content

Search the Community

Showing results for tags 'regular expressions date.au3'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I decided to play around with regular expressions to improve my (limited) knowledge and came up with a function to parse a date string into the format of YYYY/MM/DD. Therefore allowing for variations of YYYY.MM.DD or YYYY]MM@DD, since most (not all) of the functions in the Date.au3 UDF accept the format of YYYY/MM/DD. Therefore my question is can the SRE be improved at all? Thanks. #include <Date.au3> Output(@YEAR & @MON & @MDAY) Output(@YEAR & '-' & @MON & '-' & @MDAY) Output(@YEAR & '\' & @MON & '-' & @MDAY) Output(@YEAR & '/' & @MON & '/' & @MDAY) Output(@YEAR & '/ ' & @MON & '/ ' & @MDAY & '15:12:08') ; Parse a date string to the format of YYYY/MM/DD as certain formats can use '.' or '-' in certain system locales. Func _ParseDateString($sDateString) Return StringRegExpReplace(StringStripWS($sDateString, 8), '(\d{4})\V?(\d{2})\V?(\d{2})(\V*)', '$1/$2/$3 $4') ; Can this be improved in anyway? EndFunc ;==>_ParseDateString Func Output($sString) Return ConsoleWrite('[' & $sString & '] >> ' & _ParseDateString($sString) & @CRLF) EndFunc ;==>Output
×
×
  • Create New...