how to check current system date format? - vb.net

How can i check the system date format? Tried with the code below, but when i change my system's date format to another date format to test the code, it's still showing the date format before changed!
System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern()

Ok. I managed to find the solution, the 'CurrentCulture' has to be 'CurrentUICulture', instead of CurrentCulture. Which is as below:
System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern()

Related

how can i change the date format in asp boiler plate 3.1

Want to change my input type date format dddd, dd-MM-yyyy.
Any update or guidance?
try input tostring("yyyy-MM-dd") but it is default format.
Actually, I am using an asp boilerplate platform. I found that the platform only follows this date format 'yyyy-MM-dd. And this is working.

Selecting a datetime range in YII input form

Here is the problem.
I have to create a submission form on my Yii-based website. The form requires to enter a datetime range.For that I am using "jui datetimepicker" third-party Yii extension.
http://www.yiiframework.com/extension/datetimepicker/
I use two date fields with this extension pertaining to start and end time respectively. So, what I want to achieve is be able to restrict the start datetime only to time in the future (neither past dates nor time should be selected) and the end time itself should be restricted to the maximum of three hours following the start time.
EXAMPLE: a user wants to schedule an event. They choose a date and time, which are of course in the future. Let's say they choose March 15, 13 O'clock as the start time in the start time field. Once they are done and move to the next field ("end time"), the respective datetimepicker restricts the range of time from March 15, 13:00 to March 15, 16:00.
Hence the second datetimepicker should be dynamically updated depending on the input of the first one.
It's possible o specify date range in the datetimepicker starting from the current date, but there is nothing like that for the time selection, so a user still can select time which has already passed.
It's not that I want to solve this problem with this extention, if anybody has any suggestions about YII solutions allowing to specify a datetime range in the most clean and effective way - it would be much appreciated.
You should use the edaterangepicker extension instead.
Given the API for the jquery timepicker addon. you should add the following to your widget call (along side 'model','attribute', etc)
'options'=>array(
'minDateTime'=>'<start dateTime here>',
'onSelect'=>'<JS function to run>'
)
The function you run on the "onSelect" event should dynamically set the minDateTime for the second dateTime input field, for ex:
function (selectedDateTime){
<EndDatePickerElement>.datetimepicker('option', 'minDateTime', <start dateTime here using selectedDateTime> );
}
There are more examples on the link provided earlier if you need to make it even more precise (like say if you wanted the starting date to be pushed back by the amount of time the user was on the page rather than it being set when the page was loaded. etc...)

Social Engine time display format

I'm working on a Events module in SE4, and would like to display time/date in some particular format. This is the code i use now, for displaying event start time:
echo $this->locale()->toTime($event->starttime); and this code displays output 11.00 which is okay, but my question is: how to format this output?
Let's say I need output 11:00, is there a way to format it that way?
Try this
$this->locale()->toTime($event->starttime,array('format'=>'h:m'))

Date format in HTML cfgrid or SQL date format

I am trying to format dates in an HTML cfgrid. I cannot seem to make it work in CF when using HTML as the grid type. I have also tried doing it in MSSQL by using - CONVERT(VARCHAR(10), startDate, 101) AS startDate.
When I do that it shows up right in the grid but the grid will not sort on the date properly.
I understand why converting it to varchar screws up the sort but I cannot seem to make this work in either CF or SQL.
Anyone know of a way to make it show up in the grid in a mm/dd/yyyy format and also sort on the date properly?
Ability to use the mask attribute in html grids was added in CF9. To get it to work on dates you also have to specify type=date
<cfgridcolumn mask="m/d/Y" type="date" ... >
If you are using an html cfgrid, you need to use the formats found in the Ext JS Date class. NOT the date format for Flash.
Here is a link to the Ext JS Date class
<cfgridcolumn ... mask="mm/dd/yy">
source

Using drupal profile date in vb.net

I am using drupal databas ein one of my application. Drupal profile saves date in following format:
a:3:{s:5:"month";s:1:"2";s:3:"day";s:2:"18";s:4:"year";s:4:"1995";}
I can read this with data reader but how to convert in a proper display like DD/MM/YYYY or YYYY/MM/DD
Well, you can kind of see the values for month, day and year in that zany string. Presumably there is something in VB that can help you parse and glue together the string as you need it?
You might look into how PHP's unserialize() works, that will reformat the string to a more usable array.
Most of all, dont use profile, use content_profile and cck. Problem solved. Unserializing PHP serialization can get a bit hairy.