ETDtime( props.equipment.performed, props.equipment.standard_seconds, 
props.equipment.paused_seconds ) calulate ETD = start time + standard 
seconds +total puash export function ETDtime(date, standard_seconds, 
pause_seconds) { if (date) { let getdate = new Date(date); let 
get_standard_seconds = Math.floor(standard_seconds % 60); let 
get_pause_seconds = Math.floor((pause_seconds / 1000) % 60); 
getdate.setSeconds( getdate.getSeconds() + get_standard_seconds + 
get_pause_seconds ); var newdate = new Date(getdate); newdate = new Date( 
new Date(date).getTime() + standard_seconds * 1000 + pause_seconds * 1000 
); var get_date = newdate.getDate(); return ( (get_date >= 10 ? get_date : 
'0' + get_date) + '-' + (newdate.getMonth() + 1) + '-' + 
newdate.getFullYear() + ' ' + (newdate.getHours() >= 10 ? 
newdate.getHours() : '0' + newdate.getHours()) + ':' + 
(newdate.getMinutes() >= 10 ? newdate.getMinutes() : '0' + 
newdate.getMinutes()) ); } else { return ''; } } now if i am converting 
same function in django i am not getting that same value 

import datetime
from datetime import datetime, timedelta

def ETDtime(date, standard_seconds, pause_seconds):
if date:
getdate = datetime.strptime(date, '%Y-%m-%d %H:%M:%S')
get_standard_seconds = int(standard_seconds % 60)
get_pause_seconds = int((pause_seconds / 1000) % 60)
getdate += timedelta(seconds=get_standard_seconds + get_pause_seconds)
newdate = getdate + timedelta(seconds=standard_seconds + pause_seconds / 
1000)
get_date = newdate.day
return (
f'{get_date:02d}-'
f'{newdate.month:02d}-'
f'{newdate.year} '
f'{newdate.hour:02d}:'
f'{newdate.minute:02d}'
)
else:
return ''

# Given inputs
start_time = '2023-08-09 10:03:00'
paused_seconds = 30626
standard_seconds = 1200

# Calculate and print the output
output = ETDtime(start_time, standard_seconds, paused_seconds)
print(output)please help me what is wrong with my django function

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/356b437b-ab01-4f6c-821d-d7c3b86c8fe7n%40googlegroups.com.

Reply via email to