문제

strftime('%s', 'now', 'start of month') AND strftime('%s', 'now', 'start of month', '+1 month', '-1 day')

this gives me range between first and last day of current month. How can I get range of current week?

This

 strftime('%s', 'now', 'weekday 0')

gives seems to give last day of current week(Sunday), but I can't find how to get first day of current week.

PS: I use strftime in WHERE clause accessing DB in Sqlite

도움이 되었습니까?

해결책

Try this:

strftime('%s', 'now', 'weekday 0', '-1 week', '+1 day')

strftime('%s', 'now', 'weekday 0', '-1 day')

weekday modifier advances the date forward to the next date where the weekday number is N. Sunday is 0, ...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top