View Single Post
Old 06-02-2021, 03:29 AM   #13
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
This should what you want, or at least close to it.
Code:
program:
# Calculate number of seconds in a day
	one_day = 60 * 60 * 24;
# Calculate total seconds for days of loan
	loan_seconds = one_day * $#diasadevolver;
# Get the start date in ISO format
	start_day = $$#fechaprestamo;
# Get the "timestamp" for the start date -- number of seconds since epoch
	start_ts = format_date(start_day, 'to_number');
# Add the number of seconds for the days of loan	
	end_ts = start_ts + loan_seconds;
# Convert the timestamp back into a datte
	end_ts = format_date(start_ts, 'from_number');
# Format the date as desired
	end_day = format_date(end_ts, 'yyyy MM dd')
chaley is offline   Reply With Quote