myspacee Posted December 19, 2008 Posted December 19, 2008 Hello, need for a script to find in which day of year my PC is. Today 12/12/2008 is 353th day of year. need console output to redirect value to a batch, anyone can help with logic (and maybe some code)? thank you, m.
Zinthose Posted December 19, 2008 Posted December 19, 2008 #include <Date.au3> Dim $Day1 = @YEAR & "/01/01" $Days = _DateDiff("D", $Day1, _NowCalcDate() ) ConsoleWrite("! Days = " & $Days & @CRLF) --- TTFN
myspacee Posted December 19, 2008 Author Posted December 19, 2008 (edited) wonderfull here a version with user parameter : #include <Date.au3> Dim $Day1 = @YEAR & "/01/01" If $CmdLine[0] = 0 Then $Days = _DateDiff("D", $Day1, _NowCalcDate() ) ConsoleWrite($Days) ElseIf $CmdLine[0] = 1 Then $Days = _DateDiff("D", $Day1, _NowCalcDate() ) + $CmdLine[1] if $Days > 365 then $Days = $Days - 365 endif ConsoleWrite($Days) EndIf if doy > 365 remove 365 and obtain doy of next year, but doesn't work can anyone correct it ? m. Edited December 19, 2008 by myspacee
KaFu Posted December 19, 2008 Posted December 19, 2008 (edited) @YDAY = Current day of year. Range is 1 to 366 (or 365 if not a leap year) Edited December 19, 2008 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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