I'm working on a program that takes input from a user for a time. The program will take the information and automatically generate a Unix Timestamp using the current date as the date in the timestamp.
For example:
Daniel wants to generate a Unix Timestamp for 8:30 AM on Christmas Day. He runs a command
/unix 8:30
, and the console prints out1640421000
.
What's the best way to achieve this? I understand how to generate a Unix Timestamp, but how do I edit just the time to the user input. Any help would be greatly appreciated.