Ticket #282 (assigned Enhancement: null)
Update Date Formatting Help with Python Examples in Functions Like "Sample Rasters by Field"
| Reported by: | bbest | Owned by: | jjr8 |
|---|---|---|---|
| Priority: | Low | Milestone: | Unscheduled |
| Component: | Documentation | Version: | |
| Keywords: | Cc: |
Description
Because Python is much easier and more dynamic to format for date-time strings, especially with zero padding using C sprintf style, over Visual Basic, some useful examples might be shown for comparison in Sampling time series rasters and MGET Sample Rasters Listed in Fields. For example, assuming t is a date field:
- Python:
"C:/MyFolder/sst_%d%00d" % (t[0], t[7])
- Visual Basic:
"C:/MyFolder/sst_" & Cstr(DatePart("yyyy", t)) & Right("00" & Cstr(DatePart("y", t)), 3)
See Python module time documentation for the indexing of the date object for year(0), month(1), day(2), hour(3), minute (4), second(5), weekday(6), julian day(7).
Change History
Note: See
TracTickets for help on using
tickets.
