Question: I need to get the act hour in Lua without the leading zeros(in 24 hour mode)

it's like **[date("G")](http://php.net/manual/en/function.date.php)** in **PHP** 

I actually have this code

```
os.date("%d-%m-%Y %H") 

```

but it returns me 01 , 02 , 03 .... and I need to get 1 , 2, 3 etc

I found this but it doesn't seem to help me to solve my problem

[os.date formats](http://www.cplusplus.com/reference/ctime/strftime/)

Answer: 
You can just remove the leading zero:

```
os.date("%d-%m-%Y %H"):gsub(" 0"," ")

```
Try to get hour :

```
local hour = os.date("%H")

```

And try to format with string.format :

```
string.format("%d", hour)

```