Skip to main content
added 364 characters in body
Source Link
C. E.
  • 71.2k
  • 6
  • 141
  • 269

This is how you can get the last 30 weekdays starting from yesterday:

days = DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

To get {y,m,d} vectors, we might use

Take[#, 3] &@*DateList /@ days

Regarding the time zone, the only problem I can see would be that Yesterday will not produce the right result around midnight. To check this I used the Spelunking package, which told me that Yesterday is implemented as

Yesterday := DateObject[Take[DateList[], 3] - {0, 0, 1}]

DateList uses the timezonetime zone that is set on the computer you are using, so if your computer is set to the German time zone then you are alright. If not you can define a new function just like the one above but with DateList[TimeZone -> 1] instead.

This is how you can get the last 30 weekdays starting from yesterday:

days = DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

To get {y,m,d} vectors, we might use

Take[#, 3] &@*DateList /@ days

Regarding the time zone, the only problem I can see would be that Yesterday will not produce the right result around midnight. To check this I used the Spelunking package, which told me that Yesterday is implemented as

Yesterday := DateObject[Take[DateList[], 3] - {0, 0, 1}]

DateList uses the timezone that is set on the computer you are using, so if your computer is set to the German time zone then you are alright. If not you can define a new function just like the one above but with DateList[TimeZone -> 1] instead.

This is how you can get the last 30 weekdays starting from yesterday:

days = DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

To get {y,m,d} vectors, we might use

Take[#, 3] &@*DateList /@ days

Regarding the time zone, the only problem I can see would be that Yesterday will not produce the right result around midnight. To check this I used the Spelunking package, which told me that Yesterday is implemented as

Yesterday := DateObject[Take[DateList[], 3] - {0, 0, 1}]

DateList uses the time zone that is set on the computer you are using, so if your computer is set to the German time zone then you are alright. If not you can define a new function just like the one above but with DateList[TimeZone -> 1] instead.

added 364 characters in body
Source Link
C. E.
  • 71.2k
  • 6
  • 141
  • 269

This is how you can get the last 30 weekdays starting from yesterday:

days = DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

I did notice that you mentioned the timezone specifically but I'm not sure what time it is supposed to show. These are the last days after all, hours, minutes and seconds aren't well defined.

To get {y,m,d} vectors, we might use

Take[#, 3] &@*DateList /@ DayRange[DayPlus[Yesterdaydays

Regarding the time zone, the only problem I can see would be that Yesterday will not produce the right result around midnight. To check this I used the Spelunking package, which told me that Yesterday is implemented as

Yesterday := DateObject[Take[DateList[], 3] -30] {0, Yesterday0, "Weekday"]1}]

DateList uses the timezone that is set on the computer you are using, so if your computer is set to the German time zone then you are alright. If not you can define a new function just like the one above but with DateList[TimeZone -> 1] instead.

This is how you can get the last 30 weekdays starting from yesterday:

DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

I did notice that you mentioned the timezone specifically but I'm not sure what time it is supposed to show. These are the last days after all, hours, minutes and seconds aren't well defined.

To get {y,m,d} vectors, we might use

Take[#, 3] &@*DateList /@ DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

This is how you can get the last 30 weekdays starting from yesterday:

days = DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

To get {y,m,d} vectors, we might use

Take[#, 3] &@*DateList /@ days

Regarding the time zone, the only problem I can see would be that Yesterday will not produce the right result around midnight. To check this I used the Spelunking package, which told me that Yesterday is implemented as

Yesterday := DateObject[Take[DateList[], 3] - {0, 0, 1}]

DateList uses the timezone that is set on the computer you are using, so if your computer is set to the German time zone then you are alright. If not you can define a new function just like the one above but with DateList[TimeZone -> 1] instead.

added 131 characters in body
Source Link
C. E.
  • 71.2k
  • 6
  • 141
  • 269

This is how you can get the last 30 weekdays starting from yesterday:

DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

I did notice that you mentioned the timezone specifically but I'm not sure what time it is supposed to show. These are the last days after all, hours, minutes and seconds aren't well defined.

To get {y,m,d} vectors, we might use

Take[#, 3] &@*DateList /@ DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

This is how you can get the last 30 weekdays starting from yesterday:

DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

I did notice that you mentioned the timezone specifically but I'm not sure what time it is supposed to show. These are the last days after all, hours, minutes and seconds aren't well defined.

This is how you can get the last 30 weekdays starting from yesterday:

DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]

I did notice that you mentioned the timezone specifically but I'm not sure what time it is supposed to show. These are the last days after all, hours, minutes and seconds aren't well defined.

To get {y,m,d} vectors, we might use

Take[#, 3] &@*DateList /@ DayRange[DayPlus[Yesterday, -30], Yesterday, "Weekday"]
Source Link
C. E.
  • 71.2k
  • 6
  • 141
  • 269
Loading