symfony DateTimeToTimestampTransformer

I am trying to get the unix timestamp but can't seems to get it. I have form where the users need to select the date and time

$builder->add('time', 'datetime', array(
            'input'  => 'timestamp',
        ))

More info: http://symfony.com/doc/current/reference/forms/types/datetime.html#input

But all i have is an array.. when i need an integet with unix timestamp

$time = $formData['time'];

print_r($time);

Output:

Array(
 [date] => Array(
        [year] => 2015
        [month] => 6
        [day] => 7
    )
[time] => Array(
        [hour] => 6
        [minute] => 6
    ))

When I need something like 1443197171

I'm assuming you're looking at the POST data that comes back from the form which is different from the normalised data that the Symfony Forms component provides.

The visual representation is controlled by the widget option of the field, so in your case you probably want to set it to single_text like so:

$builder->add('time', 'datetime', array(
    'input'  => 'timestamp',
    'widget' => 'single_text',
));

Even then you'll probably get back an array with separate date and time entries. What you want to do is get the "data" attribute from the form component, e.g.

$form->get('time')->getData();

This gets the field component and then retrieves the data. As the entry you linked to states:

The value that comes back from the form will also be normalized back into this format.

At this point it might be best to look into the model / view structure of the form components.