function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ZarehZareh 

Contacts - Last Modified Date / time problem

Hi All,

I'm doing a SOAP call to get a contact'slast modified date and in the response its showing [ Dec 14 22:50:29 2005 ] but it is atually [ Dec 14 09:50:29 2005] so how can I make the system return 09:50 instead of 22:50

My query is: select LastModifiedDate wher FirstName = 'Zach'

Thanks
DevAngelDevAngel
Dates are returned in gmt from the web service.
ZarehZareh
Thanks Dave, so does this mean I have to add the time difference in the code or in my select statement ? We're in Australia offset +10

Cant figure out the SOQL Syntax to add the timezone offset in my SQL stetement

It should be something like: Select LastModifiedDate(+offset in hours) as lastUpdate from Contact where FirstName = 'Sonia'
DevAngelDevAngel
What are you using, java, .net, ajax???
ZarehZareh
I'm using Coldfusion MX 6.1 - it looks like I have to write a funcion to transform the date / time into the format that I want including the offset difference.

I was looking at the shortest way possible to do this via SQL.

The interestig thing is that the sforce aaplication interface detects my country settings and adds the offset where the webservice does not - I assumed that it would do this as well based on my login details where it can detect the country and set the proper ofset to ythe dates in the soap response.

Zareh
DevAngelDevAngel
So, In java, the Axis generated code handles the user's machine specified timezone as does .Net generated clients.

The key here is that it is the generated client that handles the dates. The AJAX toolkit must get the user's timezone through a javascript call and then apply that offset to the date that was recieved. If Coldfusion is not generating a client (when a client is generated, it handles the de-serialization of the soap message based on wsdl specified data types and if sophisticated enough, will handle the timezone issues for dates) then you will have to handle the time zone offset. Usually a language will provide some kind of utility function for determining the system timezone offset.

Cheers
ZarehZareh
Thank you very much for you assistance Dave.

I ended up writing a function in CF to:

1. Parse the XML response
2. Get the lastModifiedDate
3. Change it into a date/time data type
4. Apply the offset +10 for Australia
5. Use it as a new variable to continue the process...!

Hopefully will work fine...am about to test it soon.

Cheers

Zareh
dhruvadhruva
By the way, does Australia do Daylight Savings? You'll have to watch out for that.