Jump to content

Search the Community

Showing results for tags 'Unix Date Time'.

  • 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. Hi all, I needed to change a Unix Time stamp into somting that i can read . so i created a funcion to do that . I whant to know if this is the best way of doing it. Thanks in advance Func Unixdatetime($data) local $day ,$Month $LeapYear = False $Dayamount = $data / (60 * 60 * 24) $Tempdata = StringSplit($Dayamount, ".") $Dayamount = $Tempdata[1] $Tempdata = StringSplit($Dayamount / 365, ".") $LeapDayAmound = $Tempdata[1] / 4 $Year = 1970 + $Tempdata[1] $DaysLeft = $Dayamount - ($Tempdata[1] * 365) If StringInStr($LeapDayAmound, ".") Then $Tempdata = StringSplit($LeapDayAmound, ".") $LeapDayAmound = $Tempdata[1] Else $LeapDayAmound = $LeapDayAmound-1 $LeapYear = True EndIf If $DaysLeft < 31 Then $Month = 1 $day = $DaysLeft ElseIf $DaysLeft < 58 Then $Month = 2 $day = $DaysLeft - 31 ElseIf $DaysLeft < 90 Then If $LeapYear = True Then If $DaysLeft < 59 Then $Month = 2 $day = $DaysLeft - 31 Else $Month = 3 $day = $DaysLeft - 58 EndIf Else $Month = 3 $day = $DaysLeft - 58 EndIf ElseIf $DaysLeft < 120 Then $Month = 4 $day = $DaysLeft - 90 ElseIf $DaysLeft < 151 Then $Month = 5 $day = $DaysLeft - 120 ElseIf $DaysLeft < 181 Then $Month = 6 $day = $DaysLeft - 151 ElseIf $DaysLeft < 212 Then $Month = 7 $day = $DaysLeft - 181 ElseIf $DaysLeft < 243 Then $Month = 8 $day = $DaysLeft - 212 ElseIf $DaysLeft < 273 Then $Month = 9 $day = $DaysLeft - 243 ElseIf $DaysLeft < 304 Then $Month = 10 $day = $DaysLeft - 273 ElseIf $DaysLeft < 334 Then $Month = 11 $day = $DaysLeft - 304 ElseIf $DaysLeft < 365 Then $Month = 12 $day = $DaysLeft - 334 EndIf $day = $day-$LeapDayAmound $SecondsLeft1 = $data - ($Dayamount * (60 * 60 * 24)) $Tempdata = StringSplit($SecondsLeft1 / 60 / 60, ".") $uren = $Tempdata[1] $SecondsLeft2 = $SecondsLeft1 - ($uren * (60 * 60)) $Tempdata = StringSplit($SecondsLeft2 / 60, ".") $min = $Tempdata[1] $sec = $SecondsLeft2 - ($min * (60)) If StringLen($Month) < 2 Then $Month = 0 & $Month If StringLen($day) < 2 Then $day = 0 & $day If StringLen($uren) < 2 Then $uren = 0 & $uren If StringLen($min) < 2 Then $min = 0 & $min If StringLen($sec) < 2 Then $sec = 0 & $sec $export = $day & "/" & $Month & "/" & $Year &" "&$uren & ":" & $min & ":" & $sec Return $export EndFunc ;==>datetime
×
×
  • Create New...