Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
paste time day
#2
Macro Macro2965
Code:
Copy      Help
out
DateTime t.FromComputerTime
out F"{t.ToStr} - now"
t.AddParts(0 1)
out F"{t.ToStr} - now+1h"
out "-----"
Macro Macro2965
Code:
Copy      Help
out
DateTime tNow tNext
tNow.FromComputerTime
tNow.t-tNow.t%10000 ;;AddMonths ignores microseconds, then GetParts would return days-1
out F"{tNow.ToStr} - now"
tNext=sub.GetLastDayOfMonth(tNow 1)
out F"{tNext.ToStr} - last day of next month"
int daysDiff; DateTime.TimeSpanGetParts(tNext-tNow daysDiff)
out F"{daysDiff} - daysDiff"
int weekDayNow; tNow.GetParts(0 0 0 0 0 0 0 0 weekDayNow)
out F"{weekDayNow} - weekDayNow"
;I cannot help more, but now you have all info to subtract sundays and saturdays from daysDiff


#sub GetLastDayOfMonth
function'DateTime DateTime't monthsToAdd
t.AddMonths(monthsToAdd)
int year month day lastDay; t.GetParts(year month day)
lastDay=DateTime.DaysInMonth(year month)
t.AddParts(lastDay-day)
ret t


Messages In This Thread
paste time day - by amiba - 01-23-2018, 08:35 AM
RE: paste time day - by Gintaras - 01-23-2018, 12:48 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)