Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
paste time day
#1
how paste current time with these condition: 
hour has to delay one hour, e.g now time is 16.59.58 ,
17.59.58?

how to paste the difference of today to a date ,only calculate the sum of working day( not include sunday and saturday)
e.g, today 23.1.2018 ,calculate the difference from today to  the last day of next month or the next next month ( e.g. 30 of Feb =26 days  or 30 of March =XX days,), but only calculate the sum of working day( not include sunday and saturday),



Is it possible, if I type 1 , it will calculate the end day of next month(Feb) span or difference or days from today( exclude holiday like sat sun)
if I type 2, it calculate the end day of next + next month(March) span or difference or days from today ( exclude holiday like sat sun)
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)