Time variable

40 views
Skip to first unread message

jomosoft

unread,
May 21, 2022, 7:37:09 AM5/21/22
to tinspire
I need to input a time in a variable (eq 13:45) and calculate a new time bij adding some hours/minutes. Is there a way to format a time variable ? Other ideas ? 

John Hanna

unread,
May 21, 2022, 11:03:41 AM5/21/22
to tins...@googlegroups.com

TI-Basic or Python?

 

In either case: enter it as a string, parse looking for the colon (:) and extract the hours & minutes, do the mathematics, then display in a time format.

 

Or… ask for the hours and minutes using separate input statements.

--
--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinspire/c854547d-3da3-4689-a0d1-9f51781c53c6n%40googlegroups.com.

jomosoft

unread,
May 21, 2022, 11:13:16 AM5/21/22
to tinspire

Thanks John. I was hoping for an easier way but will give it a try.

John Hanna

unread,
May 21, 2022, 3:49:30 PM5/21/22
to tins...@googlegroups.com

If you are up for it… in Python you can create a time class that handles all the work for you. That would be interesting!

  • John

jomosoft

unread,
May 24, 2022, 9:59:59 AM5/24/22
to tinspire

Just ordered a cx II just to do that 😂

John Hanna

unread,
May 24, 2022, 12:15:25 PM5/24/22
to tins...@googlegroups.com

Just don’t bump into the Python time module (included).

jomosoft

unread,
Jun 13, 2022, 4:54:14 PM6/13/22
to tinspire

I created a class that accepts date and time in dd/mm/yyyy , hh:mm format and a function to calculate a date/time difference and was very happy until……I discovered that there seems to be no possibility to input a string with a colon ?
Also can’t import a string from the OS with recall_value. Input date works fine, using the divide symbol (/).
Any ideas ?

John Hanna

unread,
Jun 13, 2022, 6:16:22 PM6/13/22
to tins...@googlegroups.com

I don’t see an issue with a string containing a colon. Care to send me your file?

johne...@gmail.com

jomosoft

unread,
Jun 14, 2022, 4:10:53 AM6/14/22
to tinspire

My problem is just a simple time=input(“enter time : “). Can’t find the colon to enter something like 22:55. Maybe I missed a shortcut ? Also tried to enter the time in a spreadsheet cell but than I can’t export it to python as it seems there is no function to export a string from OS to python….

jomosoft

unread,
Jun 14, 2022, 4:25:10 AM6/14/22
to tinspire

I sent you the file John….

John Hanna

unread,
Jun 14, 2022, 6:04:21 AM6/14/22
to tins...@googlegroups.com

Well… I did not get it. Appears my email address was truncated…

 

    johnehanna at gmail.com

jomosoft

unread,
Jun 14, 2022, 6:32:10 AM6/14/22
to tinspire

Sent it again John.

To unsubscribe send email to tinspire+unsubscribe@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages