JavaScript/html time - time

I'm trying to convert the normal 24 hour system to a 20 hour system in JavaScript or html
there seems to be problems and I don't know how to fix them, the program code as a whole works ok but it's not accurate in the area of displaying the proper time
can someone help me.
24hrs per day to 20hrs
60 minutes per hour to 40 minutes per hour
60 seconds per minute to 80 seconds per minute
1000 milliseconds per second to 1350 milliseconds per second
I have been working with the code that is supposed to get the milliseconds from 1/1/1970 to make things hopefully simple but like I said the program isn't working quite right, I do have a table that lets me know what normal time would be at each changed hour but that's all the info I have

Check this Fiddle:
http://jsfiddle.net/z4s7j9vL/1/
My approach was to get the timestamp difference between the current time and midnight of the same day:
millis = ts - clone.getTime();
This way you get how many milliseconds have passed this day and you can do your conversion from there. This is limited to converting time only, but if months and years followed the same principles you could just convert the same way from the current timestamp.

Related

I have a work time of 90 hours, I want to subtract hour:minutes worked to get hours:minutes left to complete work in a libreoffice spreadsheet

I have set 90 hours to complete a job.
Every time I work on the job I want to subtract that time from 90 (90 - time worked)
This is to be done in a Libreoffice spreadsheet

change max output of Milliseconds from 1000 to 2000 in HTML

I am wondering how to change the time format of natural time from 24 hours 60 minutes 60 seconds 1000 milliseconds to 30 hours 30 minutes 30 seconds 3200 milliseconds in HTML
Ok, makes slightly more sense now. Firstly you want this to be done in JavaScript. HTML is markup. If you are saying you wish to change the time format, then I can give you examples of changing the format (i.e.: dd-mm-yyyy to mm-dd-yyyy, and many many other variations). Check this out - there you find lots of examples. If you want to turn a day into 30 hours, however, then this is a proper customisation you have to do. So basically a timer that adds a new hour each 30 minutes, and a minute each 30 seconds. Not sure if that's worth the effort for amusement purposes only ? You might want to impress your friends with other things ... i.e. how quickly you can down a pint!

Why timer control makes the application very slow

The program in windows form application is working well until i use timer control where i choose the interval of it (1 ms) to get 1000 values, visually i should get these 1000 values in a period of one second but i get them in a period of about 14 seconds it's very slow.
Does anyone know why and how to solve this?

How much monthly hours does the Scheduler addon take on Heroku?

In the Heroku documentation it's said that addons, such as Scheduler, add up to your montly hours, meaning you would have to pay if it adds up more than 30 hours (I have only one web dyno, so I'm using 720 montly hours, and the maximum free is 750 hours). So, how to calculate how much Scheduler takes from your montly hours? For example, if I have a daily task, how much would it take from my montly hours?
It means the wall clock time of the time taken for the jobs that are executed by scheduler to run.
So, for instance, if you're running a 1 minute job every hour, you'd be looking at 720 minutes of time every 30 days.
I believe this last answer is incorrect - the scheduler costs the same hourly as a regular dyno - right?

using date function in unix

how can I determine machine time in seconds on unix O/S? (i can't use 'date +%s', it's not POSIX).
what functions exist for date and epoch time in second?
by using date "+%format" how can i subtract 1-2 hour from present hour?
Regards
Try the time function in time.h. For example:
time_t the_time=time(NULL);
// the_time now contains the number of seconds since the epoch
To get a time in the past, just subtract the number of seconds. Since there are 3600 seconds in an hour, to go an hour back, just subtract 3600.

Resources