current time

current time - Сообщения

#1 Опубликовано: 24.09.2013 14:43:57
sublim21

sublim21

3 сообщений из 36 понравились пользователям.

Группа: User

Hey All,

I'd like to request a feature to get the current time.

timeRightNow:=curTime( 'format' )

where 'format' is the format of time requested (UTC, standard time, etc)

Thanks,

-Pete
#2 Опубликовано: 24.09.2013 15:50:40
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

A good start could be time().
You also can access the Maxima function timedate(), use string command format, as this is the only way to convey an empty argument list.

Function: timedate ()
Function: timedate (T)
timedate() with no argument returns a string representing the current time and date. The string has the format YYYY-MM-DD HH:MM:SS[+|-]ZZ:ZZ, where the fields are year, month, day, hours, minutes, seconds, and time zone offset in hours and minutes.

timedate(T) returns the time T as a string with the format YYYY-MM-DD HH:MM:SS[+|-]ZZ:ZZ. T is interpreted as the number of seconds since midnight, January 1, 1900, as returned by absolute_real_time.

Example:

timedate with no argument returns a string representing the current time and date.

(%i1) d : timedate ();
(%o1) 2010-06-08 04:08:09+01:00
(%i2) print ("timedate reports current time", d) $
timedate reports current time 2010-06-08 04:08:09+01:00
timedate with an argument returns a string representing the argument.

(%i1) timedate (0);
(%o1) 1900-01-01 01:00:00+01:00
(%i2) timedate (absolute_real_time () - 7*24*3600);
(%o2) 2010-06-01 04:19:51+01:00

timedate.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений