# Time

The time class.

self + other

Returns a time that is later than self by other seconds.

self - other

When other is a Time object, returns the difference between the two times with Float. If other is a numeric value, returns a time that is earlier than self by other.

self <=> other

Compares times. other must be a Time object or a numeric value; if a numeric value, the times are compared in terms of seconds since the epoch began.

strftime(format)

Returns the time, having been converted into a string via a format string. The format string may be specified with the following:

* %A

  Day of the week (Sunday, Monday ... )
* %a

  Day of the week, abbreviated (Sun, Mon ... )
* %B

  Month (January, February ... )
* %b

  Month, abbreviated (Jan, Feb ... )
* %c

  Date and time
* %d

  Day of the month (01-31)
* %H

  Time of day, 24-hour format (00-23)
* %I

  Time of day, 12-hour format (01-12)
* %j

  Day of the year (001-366)
* %M

  Minutes (00-59)
* %m

  Month of the year (01-12)
* %p

  AM or PM
* %S

  Seconds (00-60, 60 being a leap second)
* %U

  Week of the year, the first week starting with the first Sunday (00-53)
* %W

  Week of the year, the first week starting with the first Monday (00-53)
* %w

  Day of the week (0-6, 0 denoting Sunday)
* %X

  Time
* %x

  Date
* %Y

  Year, 4-digit
* %y

  Year, 2-digit (00-99)
* %Z

  Time zone
* %%

  The character %

sec

Returns the seconds.

min

Returns the minutes.

hour

Returns the hour.

mday

Returns the day.

mon

Returns the month.

year

Returns the year.

wday

Returns the number representing the day of the week.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enls.gitbook.io/rgss-reference-manual/standard-library/built-in-classes/object/time.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
