Ben Hamilton

Git Workflow Explained Simply

Git is a Code Versioning System (aka CVS) . It lets multiple developers, programers and project managers all work on the source code for a project with minimal stepping on each others toes. The workflow we use is as follows. We keep the a Git repository in the cloud, typically in Bitbucket. Each developer then […]

Posted in Productivity | Tagged , | Comments Off on Git Workflow Explained Simply

How to convert UTC time to current timezone in MySQL

Using SugarCRM (this client is using Enterprise 6.5.15) and we want the last two hundred items in the tracker table. The problem is that the `tracker`.`date_modified` field is in UTC time, not the local time zone, which is +10:00. The solution is to use the CONVERT_TZ MySQL command, as shown in the example below. It […]

Posted in SugarCRM | Tagged , , , | Comments Off on How to convert UTC time to current timezone in MySQL

MySQL snippet for past and next 6 Months

Spent some time today working with DATEDIFF, DATE_ADD and all kinds of horrid looking code before realising that to do a MySQL query to get records where the date is in the past or the next x months all I need is the following. WHERE t_position_cstm.review_date_c <= DATE_ADD(DATE(now()), INTERVAL 6 MONTH) You can change the […]

Posted in SugarCRM | Tagged , , | Comments Off on MySQL snippet for past and next 6 Months