<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DateTime &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/datetime/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 25 Mar 2025 17:56:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Windows ICU Changes</title>
		<link>https://blog.xojo.com/2025/03/25/windows-icu-changes/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 25 Mar 2025 15:33:53 +0000</pubDate>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[2025r1]]></category>
		<category><![CDATA[DateTime]]></category>
		<category><![CDATA[ICU]]></category>
		<category><![CDATA[Locale]]></category>
		<category><![CDATA[TimeZone]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[Windows 10]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=14613</guid>

					<description><![CDATA[For many years, Xojo included prebuilt ICU libraries (International Components for Unicode) on Windows to ensure consistent Unicode behavior across platforms. However, maintaining and updating&#8230;]]></description>
										<content:encoded><![CDATA[
<p>For many years, Xojo included prebuilt ICU libraries (International Components for Unicode) on Windows to ensure consistent Unicode behavior across platforms. However, maintaining and updating ICU manually required rebuilding it with each release, and users wouldn’t receive updates unless they updated Xojo itself.</p>



<p>With Windows 10 version 1703, Microsoft introduced built-in ICU support, allowing applications to use the system provided ICU instead of bundling their own. By leveraging this, Xojo now benefits from automatic updates, a reduced app footprint, and improved compatibility with the latest Unicode and locale data.</p>



<h2 class="wp-block-heading"><strong>Which parts of the framework use ICU?</strong></h2>



<p>One of the main areas where ICU is used is the DateTime class, which includes Locale and TimeZone support. This helps with formatting dates and times and handling timezone differences reliably. ICU is also used for number formatting and string manipulation, particularly when working with characters like emojis and other complex Unicode symbols.</p>



<h2 class="wp-block-heading"><strong>What benefits can be observed?</strong></h2>



<ul class="wp-block-list">
<li>Fewer DLLs</li>



<li>45MB smaller app sizes</li>



<li>Faster execution times, i.e. DateTime.Now is roughly 10% faster</li>



<li>Daylight saving time no longer requires a rebuild of your Xojo app</li>
</ul>



<h2 class="wp-block-heading"><strong>What are the new requirements?</strong></h2>



<p>As mentioned, Windows began including prebuilt ICU libraries starting with Windows 10 version 1703, so your apps won&#8217;t run on earlier versions. However, if you&#8217;re using Windows Server 2019, you&#8217;ll need to be on at least version 1809.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>By shifting to Windows&#8217; built-in ICU libraries, Xojo has eliminated the need for manual ICU updates and reducing app file sizes. This change means your apps will always have the latest updates for date/time, locale, and character handling, thanks to Windows updates.</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>iOS: Selecting Date and Time with More Style</title>
		<link>https://blog.xojo.com/2024/06/26/ios-selecting-date-and-time-with-more-style/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Wed, 26 Jun 2024 15:00:00 +0000</pubDate>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[2024r2]]></category>
		<category><![CDATA[DateTime]]></category>
		<category><![CDATA[MobileDateTimePicker]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=13166</guid>

					<description><![CDATA[Xojo 2024r2 introduces two new styles for the iOS DateTimePicker control. In previous releases, the DateTimePicker control offered only the Wheels Display Style. This release adds two more options: Compact and Inline. The Compact and the Inline Display Styles will allow you to create cleaner and more flexible user interfaces in your iOS apps. ]]></description>
										<content:encoded><![CDATA[
<p>Xojo 2024r2 introduces two new styles for the iOS <a href="https://documentation.xojo.com/api/user_interface/mobile/mobiledatetimepicker.html#mobiledatetimepicker">DateTimePicker</a> control. In previous releases, the DateTimePicker control offered only the Wheels Display Style. This release adds two more options: Compact and Inline. The Compact and the Inline Display Styles will allow you to create cleaner and more flexible user interfaces in your iOS apps. </p>



<span id="more-13166"></span>



<h2 class="wp-block-heading">Compact Display Style</h2>



<p>When using the Compact Display Style, the control adjusts itself to offer two fields for Date and Time selection or just one field in those cases when the Display Mode is set to Date or Time. In any case, this Display Style consumes less real screen space in the UI, making it ideal for more compact interface designs.</p>



<p>For example, use it when designing <a href="https://documentation.xojo.com/api/user_interface/mobile/mobiletablecustomcell.html#mobiletablecustomcell">custom cells</a> for a <a href="https://documentation.xojo.com/api/ios/iosmobiletable.html#iosmobiletable-datasource">MobileTable DataSource</a>:</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img fetchpriority="high" decoding="async" width="1170" height="1661" src="https://blog.xojo.com/wp-content/uploads/2024/06/CalendarCompact.png" alt="" class="wp-image-13168" srcset="https://blog.xojo.com/wp-content/uploads/2024/06/CalendarCompact.png 1170w, https://blog.xojo.com/wp-content/uploads/2024/06/CalendarCompact-211x300.png 211w, https://blog.xojo.com/wp-content/uploads/2024/06/CalendarCompact-721x1024.png 721w, https://blog.xojo.com/wp-content/uploads/2024/06/CalendarCompact-768x1090.png 768w, https://blog.xojo.com/wp-content/uploads/2024/06/CalendarCompact-1082x1536.png 1082w" sizes="(max-width: 1170px) 100vw, 1170px" /></figure>
</div>


<h2 class="wp-block-heading">Inline Display Style</h2>



<p>On the other hand, the Inline Display Style is ideal for date selection because it renders a calendar in the view that speeds up the date selection by the user. It includes options for rapidly moving among the month or the year to be displayed. This is much faster compared with spinning the wheel for a date in the Wheels Display Style:</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img decoding="async" width="1170" height="1547" src="https://blog.xojo.com/wp-content/uploads/2024/06/CalendarInline.png" alt="" class="wp-image-13167" srcset="https://blog.xojo.com/wp-content/uploads/2024/06/CalendarInline.png 1170w, https://blog.xojo.com/wp-content/uploads/2024/06/CalendarInline-227x300.png 227w, https://blog.xojo.com/wp-content/uploads/2024/06/CalendarInline-774x1024.png 774w, https://blog.xojo.com/wp-content/uploads/2024/06/CalendarInline-768x1015.png 768w, https://blog.xojo.com/wp-content/uploads/2024/06/CalendarInline-1162x1536.png 1162w" sizes="(max-width: 1170px) 100vw, 1170px" /></figure>
</div>


<h2 class="wp-block-heading">Conclusion</h2>



<p>We are sure that the new Inline and Compact Display Styles will help polish your UIs and we look forward to seeing how you use them in your iOS apps. Thank you to everyone who filed cases and offered feedback for this release.</p>



<p>Happy coding!</p>



<p><em>Javier Menendez is an engineer at Xojo and has been using Xojo since 1998. He lives in Castellón</em>, <em>Spain and hosts regular Xojo hangouts en español. Ask Javier questions on Twitter at <a href="https://twitter.com/xojoes" target="_blank" rel="noreferrer noopener">@XojoES</a> or on the <a href="https://forum.xojo.com/u/javier_menendez/summary" target="_blank" rel="noreferrer noopener">Xojo Forum</a>.</em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>DateTimePicker for Xojo Desktop</title>
		<link>https://blog.xojo.com/2020/11/24/datetimepicker-for-xojo-desktop/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Tue, 24 Nov 2020 14:00:56 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[DateTime]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=7713</guid>

					<description><![CDATA[Add the new native DateTimePicker control to your Window Layouts to get the same look, feel and behavior you'd expect from the OS itself.]]></description>
										<content:encoded><![CDATA[
<p>Add the new native DateTimePicker control to your window layouts to get the same look, feel and behavior you&#8217;d expect from the OS itself.</p>



<p>You can now offer your users the ability to select a date and/or time value in a graphical way (from a Calendar view, for example) or using the text mode the user can enter the values for the year, month, day, hour, minute and (optionally) also the seconds. Of course you will be able to display a preselected date and/or time on the control.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="624" height="430" src="https://blog.xojo.com/wp-content/uploads/2020/11/XojoDateTimePicker.gif" alt="" class="wp-image-7714"/></figure></div>



<p>In order to start using the DateTimePicker control in your apps: Drag and drop the DateTimePicker control from the Library to the Window Layout. Use the Inspector Panel to set the instance in graphic or text mode (on Linux you are limited graphic mode).</p>



<p>Implement the DateChanged Event Handler in the DateTimePicker control instance. You&#8217;ll receive as parameter a DateTime object with the selected date and time values.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="360" height="323" src="https://blog.xojo.com/wp-content/uploads/2020/11/DateTimePickerProperties.png" alt="" class="wp-image-7715" srcset="https://blog.xojo.com/wp-content/uploads/2020/11/DateTimePickerProperties.png 360w, https://blog.xojo.com/wp-content/uploads/2020/11/DateTimePickerProperties-300x269.png 300w" sizes="auto, (max-width: 360px) 100vw, 360px" /></figure></div>



<p>Optionally you can set other properties via code, for example: display the seconds value for the Time section of the DateTimePicker, set the initial date/time values or set a minimum and/or maximum selectable date value for the Calendar section.</p>



<p>All the properties are settable via code at runtime; so this means that you can change the behavior of the DateTimePicker as you need.</p>



<p>Questions? Ask me about Xojo programming on Twitter <a href="https://twitter.com/xojoes">@XojoES</a> or on the <a href="https://forum.xojo.com/u/javier_menendez/summary">Xojo Forum</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Let’s talk DateTime</title>
		<link>https://blog.xojo.com/2019/10/14/lets-talk-datetime/</link>
		
		<dc:creator><![CDATA[Wayne Golding]]></dc:creator>
		<pubDate>Mon, 14 Oct 2019 19:56:38 +0000</pubDate>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Guest Post]]></category>
		<category><![CDATA[2019r2]]></category>
		<category><![CDATA[DateTime]]></category>
		<category><![CDATA[Xojo API 2.0]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=6121</guid>

					<description><![CDATA[In Xojo Release 2019R2 a new DateTime class was introduced.  This is a Time zone aware Date Class and is immutable which is great compared to the deprecated Date class.  ]]></description>
										<content:encoded><![CDATA[
<p>In Xojo Release 2019R2 a new DateTime class was introduced.&nbsp; This is a Time zone aware Date Class and is immutable which is great compared to the deprecated Date class.&nbsp; How many of us have had issues working out why when we stepped through changing a Date it worked, but didn’t when not?&nbsp; I know I did in the early days.</p>



<p>DateTime is cool. You can create a variable that stores the date/time now with:</p>



<pre class="wp-block-preformatted">Var dt As DateTime = DateTime.Now</pre>



<p>Or:</p>



<pre class="wp-block-preformatted">Var dt As New DateTime(TimeZone.Current)</pre>



<p>The second variant allows you to simply find the date/time now in any time zone:</p>



<pre class="wp-block-preformatted">Var dt As New DateTime(New TimeZone("NZ")) ' Local time for me and Rocket Lab launch site 1</pre>



<p>Or:</p>



<pre class="wp-block-preformatted">Var dt As New DateTime(New TimeZone("UTC")) ' Local time in Greenwich</pre>



<p>Sometimes you need to calculate a date:</p>



<pre class="wp-block-preformatted">Var dt As DateTime = DateTime.Now.AddInterval(0, 1) ' today next month</pre>



<p>Or:</p>



<pre class="wp-block-preformatted">Var dt As DateTime = DateTime.Now.SubtractInterval(0, 1) ' today last month</pre>



<p>You can obviously use the components of a DateTime in your calculation, e.g. finding the 20<sup>th</sup> of next month:</p>



<pre class="wp-block-preformatted">Var dt As DateTime = DateTime.Now.AddInterval(0, 1, 20 – DateTime.Now.Day)</pre>



<p>DateTime is based on seconds from 1970 which allows for simple conversions between TimeZones and is daylight savings time aware.</p>



<p>How awesome is this?</p>



<p><em>Wayne Golding has been a Xojo developer since 2005. He operates the IT Company Axis Direct Ltd www.axisdirect.nz which primarily develops applications using Xojo that integrate with Xero www.xero.com.  Wayne’s hobby is robotics where he uses Xojo to build applications for his Raspberry Pi, often implementing IoT for remote control.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>New DateTime Class</title>
		<link>https://blog.xojo.com/2019/10/09/new-datetime-class/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Wed, 09 Oct 2019 11:00:57 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[2019r2]]></category>
		<category><![CDATA[DateTime]]></category>
		<category><![CDATA[TimeZone]]></category>
		<category><![CDATA[Xojo API 2.0]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=6075</guid>

					<description><![CDATA[The New DateTime class introduced in Xojo 2019r2 is meant as a replacement for the now deprecated Date class. Let&#8217;s take a look at how&#8230;]]></description>
										<content:encoded><![CDATA[
<p>The New DateTime class introduced in Xojo 2019r2 is meant as a replacement for the now deprecated Date class.  Let&#8217;s take a look at how these two classes compare:</p>



<h3 class="wp-block-heading"><strong>Date</strong></h3>



<ul class="wp-block-list"><li>Mutable (you can change any of its properties without having to create a new Date)</li></ul>



<p>On the surface this sounds great, but you can get into some ambiguous Dates depending on the order of operation, for example:<br><pre>Dim d As New Date(2019, 2, 28)    // February 28, 2019<br>d.Day = 31   // February 31, 2019?<br>d.Month = 3</pre></p>



<p>In reality since February 31 is not a valid date we have to coerce it into one, in this case we roll over as 3 days into March, so after the Day has been set to 31 the actual date is now March 3, 2019, probably not what the user intended.</p>



<ul class="wp-block-list"><li>Uses local TimeZone (no way to use a different TimeZone)</li></ul>



<p>Consider living in California and trying to determine the time in New York.  With the Date class you&#8217;d have to calculate the time offset yourself.</p>



<ul class="wp-block-list"><li>Uses current locale for date string formatting (no way to use a different locale)</li></ul>



<p>If you&#8217;re trying to display something for your French or Spanish speaking compadre and you&#8217;re on a English speaking region, you&#8217;d have to format the date yourself.</p>



<ul class="wp-block-list"><li>Fixed GMTOffset (no understanding of daylight savings rollover)</li></ul>



<p>The GMTOffset is always the current TimeZone offset, unless its has been specifically set in one of the Date constructors.</p>



<h3 class="wp-block-heading"><strong>DateTime</strong></h3>



<ul class="wp-block-list"><li>Immutable (none of its properties can be modified, you&#8217;d have to create a new DateTime)</li></ul>



<p>While this may seem more restrictive, this provides protection against setting ambiguous dates.  You can use DateInterval and/or DateTime.AddInterval to manipulate the date which is returned as a new DateTime object.</p>



<ul class="wp-block-list"><li>TimeZone savvy</li></ul>



<p>Each DateTime object can be associated with a different TimeZone.  For a list of all the supported TimeZone names, see:<br> <a href="https://docs.oracle.com/cd/E41183_01/DR/ICU_Time_Zones.html">https://docs.oracle.com/cd/E41183_01/DR/ICU_Time_Zones.html</a></p>



<ul class="wp-block-list"><li>Date formats are locale savvy</li></ul>



<p>Instead of being tied to presenting a date string in the current locale, you can specify a different locale in which to display your formatted date string.</p>



<ul class="wp-block-list"><li>Daylight savings aware</li></ul>



<p>A TimeZone is always associated with a DateTime object (if none is specified then the current TimeZone is used), you can use the TimeZone.SecondsFromGMTOffset to determine if the Date is in daylight savings.</p>



<p><strong>Daylight savings boundary behavior</strong></p>



<p>When daylight savings end on November 3, 2019 at 2:00am the date will fall back one hour so we really are on November 3, 2019 at 1:00am.  So how does Xojo handle the case where a user sets the date to be November 3, 2019 at 1:00am?  Is it just before daylight savings or after?  The answer is, after, with the TimeZone GMTOffset adjusted accordingly.</p>



<p>For more information about the new DateTime class, make sure to check out the documentation page on it:  <a href="http://documentation.xojo.com/api/deprecated/date.htmlTime">http://documentation.xojo.com/api/deprecated/date.htmlTime</a> </p>


]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
