On Tuesday, 15 June 2021 at 15:57:07 UTC+5:30 eugenet...@gmail.com wrote:
Dear NA,I accomplished this with numpy. How can I get the value (difference between the two dates) when I select the second date for example in the text field? I know Javascript can be used but how?On Tue, 15 Jun 2021 at 11:14, Nikeet NA <nik...@exiverlabs.co.in> wrote:You need to loop through the dates maintain a count variable get the weekday for every datetime object with date.weekday() exclude as per your need for days you dont want to count.On Tuesday, 15 June 2021 at 11:30:21 UTC+5:30 eugenet...@gmail.com wrote:Team,I have date1 and date2 fields. I am able to calculate number of days between the two dates using relativedelta as shown below:date1 = datetime.datetime.strptime(str(end_date), '%Y-%m-%d')date2 = datetime.datetime.strptime(str(start_date), '%Y-%m-%d')r = relativedelta.relativedelta(date1, date2)n_days=r.daysWhat I want now is calculating the days but excluding weekends days. Again I want to pick the second date and get the number of days (date2-date1) in the text field directly.Please help.Thanks--Eugene--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/16ba7533-93ba-4925-9f93-e430d7128342n%40googlegroups.com.
--Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38eugenet...@gmail.comEmail: eugene....@aims-cameroon.orgTUYIZERE EugeneMsc Degree in Mathematical ScienceAfrican Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, CameroonBsc in Computer ScienceUR-Nyagatare Campus
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f90effb8-2ba5-49fa-b340-cd8862d3e039n%40googlegroups.com.
No comments:
Post a Comment