User Tools

Site Tools


ttrack:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
ttrack:start [2012/11/28 18:24]
andy created
ttrack:start [2012/12/11 12:09]
andy
Line 10: Line 10:
 Basic tokens can be implemented with ''​strptime()'',​ but (in Python at least) unparsed suffix data cause an exception which means we need to know in advance how many tokens to consume. This is the reason why we need both ''<​date>''​ and a ''<​year>''​ tokens, for example. Basic tokens can be implemented with ''​strptime()'',​ but (in Python at least) unparsed suffix data cause an exception which means we need to know in advance how many tokens to consume. This is the reason why we need both ''<​date>''​ and a ''<​year>''​ tokens, for example.
  
-**''<​time>''​** +Phrases such as "next Monday"​ can be ambiguous, but they're very common so a reasonable interpretation is probably still useful. The table below shows the offset in days from the current day for each of the three phrases shown:
-  * ''​%I:%M:​%S%p''​ +
-  * ''​%I:​%M%p''​ +
-  * ''​%H:​%M:​%S''​ +
-  * ''​%H:​%M''​+
  
-**''<​date>''​** +^ Day ^ "last Wednesday"​ ^ "this Wednesday"​ ^ "next Wednesday"​ ^ 
-  * ''​%Y-%m-%d''​ +^ Monday | -5d | +2d | +9d | 
- +^ Tuesday | -6d | +1d | +8d | 
-**''<​year>''​** +^ Wednesday | -7d | +7d | +7d | 
-  * ''​%Y''​ +^ Thursday | -8d | -1d | +6d | 
-  * ''​%y''​ +^ Friday | -9d | -2d | +5d | 
- +^ Saturday | -10d | -3d | +4d | 
-**''<​month>''​** +^ Sunday | -11d | -4d | +3d |
-  * ''​%m''​ +
-  * ''​%b''​ +
-  * ''​%B''​ +
- +
-**''<​monthday>''​** +
-  * ''​%d''​+
  
 +Note the inconsistency where "​this"​ becomes synonymous with "​next"​ for the current day --- this reflects the fact that I don't believe someone would ever say "this Wednesday"​ if they meant "​today"​.
  
 +A bare day of the week (e.g. just "​Tuesday"​) is always taken as the day of the //current// week (Monday-based),​ as opposed to some date parsing packages which regard this as synonymous with "next Tuesday"​. This means it doesn'​t quite correspond exactly with any of the last/​this/​next interpretations,​ but that's probably OK.
ttrack/start.txt · Last modified: 2012/12/11 12:16 by andy