<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 27, 2012, at 5:07 PM, jda wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; ">I have a method that uses datediff to determins if a record was created in the last 2 weeks:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "> dateAdded > datediff( now(), '01/01/1904 00:00:00', 'second' ) - (14 * 24 * 60 * 60)<span style="font: 12.0px Helvetica"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><span style="font: 12.0px Helvetica"><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><span style="font: 12.0px Helvetica">This works well on US Macs.</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><span style="font: 12.0px Helvetica"><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><span style="font: 12.0px Helvetica">You told me to use</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><span style="font: 12.0px Helvetica"><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "> dateAdded > datediff( now(), '01-01-1904 00:00:00', 'second' ) - (14 * 24 * 60 * 60)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; ">for European systems. I checked this by changing my settings to German (in the International System Preferences). But not <i>neither</i> search works.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; ">So, what should I use for the day, month, and year for different regions?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Times New Roman'; "><br></div></div></blockquote></div><div><br></div><div>I suspect that such a problem will be arisen sooner or later.</div><div>Actually now() is about local time - so you can not use it worldwide as a timestamp.</div><div><br></div><div>Usually UTC time is used for such purposes.</div><div>But I can not recall - do we have such a function or not.</div></div></blockquote><div><br></div></div><div>Hi Ivan,</div><div><br></div><div>But that's not the problem. It works just fine form my purposes (local time). The problem is the format for the date parameter:</div><div><br></div><div> 01/01/1904</div><div><br></div><div>works if the system language (international setting) is set to English.</div><div><br></div><div>It fails if the language is set to German. I thought</div><div><br></div><div><div> 01-01-1904</div><div><br></div><div>would work, but the search -> no results (there should be many when the language is German (or English).</div><div><br></div><div>This is all on the same Mac in one time zone, there there should be no issues with now().</div><div><br></div></div></div></blockquote></div><div><br></div>Hi Jon,<div><br></div><div>Actually, it is not related to the language - it is only related to the date-time format property.</div><div>And so, if user can set any format himself you can not hardcoded date literals in your queries.</div><div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>-- <br>Best regards,<br>Ivan Smahin<br>Senior Software Engineer<br>Paradigma Software, Inc<br>Valentina - The Ultra-Fast Database<br><a href="http://www.valentina-db.com/">http://www.valentina-db.com</a></div></span>
</div>
<br></div></div></body></html>