Question: I want to find the date,month and year through a given set of numbers using the array and pointers.I am writing the program to learn C.

Below is the output:

Enter the number : 22102013
Today is the day is 22,month is 10 and the year is 2013.

And i have wrote the following code.

```
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char date [11];

    char days []="DD";
    char month[]="MM";
    char year []="YYYY";

    printf("Enter the year that you want \n");
    scanf ("%d",&date[11]);

    char *my_pointer = date;
    days[0] = *(my_pointer);
    days[1] = *(my_pointer+1);

    month[0]=*(my_pointer+2);
    month[1]=*(my_pointer+3);

    year [0]=*(my_pointer+4);
    year [1]=*(my_pointer+5);
    year [2]=*(my_pointer+6);
    year [3]=*(my_pointer+7);

printf("Today the day is %s,the month is %s and the year is %s",days,month,year);
    return 0;
}

```

Also i had not initialized the array size but it kept raising error for declaration of the array.

Answer: 
credit to @engineersmnky

```
hour = 19
minute = 0
time_zone = 'Chennai'

e = Time.zone.now.change({hour: hour, minute: minute}).in_time_zone(time_zone).to_i

```
You need to convert it to UTC:

```
DateTime.now.change({hour: time, minute: hour}).time_zone('IST').utc

```

Or if you are in Rails 4 or above you can use in\_time\_zone:

```
DateTime.now.change({hour: time, minute: hour}).in_time_zone('IST').utc

```