Hi, I'm using SugarCE 5.2c.

I have a custom module, containing a pre-made field called date_entered - I did not create this field, it was just there when I created the module. This field automatically stores the date and time, but I only want the date. So, I created a before_save logic hook containing:

$buyer = $bean->contacts_rej_buyerjobs_name . ' - ' . date('d-m-Y', $bean->date_entered);
$bean->name = $buyer;

I realise I can simply use date('d-m-Y') to save the current date, but I don't want the 'buyer' field's value to change every time someone saves the record.

Anyway, it only partially works - it successfully discards the time, but the date is always 01-01-1970. I really have no idea why. I tried experimenting with date/time settings in Sugar, but no luck.

What do you think is the solution to this?

AG