Skip to main content

Posts

Change date format in jquery datepicker

Change date format in jquery datepicker We can change the date format in jquery ui datepicker. <script> $(function() { $("#datepicker1").datepicker({showOn: 'both', buttonImage: 'images/calendar.gif', buttonImageOnly: true, changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'dd-mm-yy', yearRange: '1900:2025' }); }); </script> Demo:Normal JQuery ui datepicker Date: Demo:Changed JQuery ui datepicker Date:
Recent posts

SQL Difference between Union & Union All

SQL Difference between Union & Union All The union and union all operators allow you to combine multiple data sets. The difference between the two is that union sorts the combined set and removes duplicates while union all does not. With union all, the number of rows in the final data set will always equal the sum of the number of rows in the sets being combined.[Learning SQL By Alan Beaulieu] When using the UNION command all selected columns need to be of the same data type. For example : X Y UNION UNION ALL A B A A A B B A B A - B - - - B - - - B - - - A Union all is faster than union, union's duplicate elimination requires a sorting operation, which takes time.

Difference between SQL Truncate & SQL Delete

SQL - Difference between Truncate & Delete 1. TRUNCATE is a DDL (Data Definition Language) command and DELETE is a DML (Data Manipulation Language) command. 2. You can use WHERE clause with DELETE but not with TRUNCATE . 3. You cannot rollback data in TRUNCATE but in DELETE it is possible to rollback data. 4. A trigger doesn't get fired in case of TRUNCATE whereas Triggers get fired in case of a DELETE command. 5. TRUNCATE is faster than DELETE . TRUNCATE is faster than DELETE due to the way TRUNCATE "removes" rows. Actually, TRUNCATE does not remove data, but rather deallocates whole data pages and removes pointers to indexes. The data still exists until it is overwritten or the database is shrunk. This action does not require a lot of resources and is therefore very fast. 6. TRUNCATE resets the Identity counter if there is any identity column present in the table where DELETE does not reset the identity counter. 7. You cannot TRUNCATE a tab...

How to format datetime & date in Sql Server 2005

– Microsoft SQL Server T-SQL date and datetime formats – Date time formats – mssql datetime  – MSSQL getdate returns current system date and time in standard internal format SELECT   convert ( varchar ,   getdate (),  100 )   – mon dd yyyy hh:mmAM (or PM)                                          – Oct  2 2008 11:01AM           SELECT   convert ( varchar ,   getdate (),  101 )   – mm/dd/yyyy  -  10/02/2008                   SELECT   convert ( varchar ,   getdate (),  102 )   – yyyy.mm.dd – 2008.10.02           ...

Javascript search Function in keyup event

 Script: <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#searchbox').keyup(function() { searchTable($(this).val()); }); }); function searchTable(inputVal) { var table = $('#search'); table.find('tr').each(function(index, row) { var allCells = $(row).find('td'); if(allCells.length > 0) { var found = false; allCells.each(function(index, td) { var regExp = new RegExp(inputVal, 'i'); if(regExp.test($(td).text())) { found = true; return false; } }); if(found == true)$(row).show();else $(row).hide(); } }); } </script> <label >Find By Name/Company Name</label><input type="text" id="searchbox"  /> demo: Find By Name/Company Name Name Company Name karthik aeykay technologies Gowshik Sundar CTS ...

Facebook Like Time Ago Function C#

This is a small time ago function which return a date time value in a readable way as facebook,twitter and most of the forum sites..eg(1 day ago,1 min ago etc).used c# programming language.. C# public static string TimeAgo( DateTime date)      {      TimeSpan timeSince = DateTime .Now.Subtract(date);      if (timeSince.TotalMilliseconds < 1)         return "not yet" ;      if (timeSince.TotalMinutes < 1)         return "just now" ;      if (timeSince.TotalMinutes < 2)         return "1 minute ago" ;      if (timeSince.TotalMinutes < 60)         return string .Format( "{0} minutes ago" , timeSince.Minutes);      if (timeSince.TotalMinutes < 120) ...

JavaScript Date and Time Functions

script:  <script type="text/javascript"> function startTime() { var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December") var today=new Date(); var h=today.getHours(); var m=today.getMinutes(); var s=today.getSeconds(); var d=today.getDate(); var mo=today.getMonth(); var ye=today.getFullYear(); // add a zero in front of numbers<10 mo=montharray[today.getMonth()]; d=checkTime(d); ye=checkTime(ye); m=checkTime(m); s=checkTime(s); h=checkTime(h); var hour; if(h == 0) {hour = 12;var ap = " AM";} else if(h <= 11) {ap = " AM";hour = h;} else if(h == 12) {ap = " PM";hour = 12;} else if (h >= 13) {hour = (h - 12);ap = " PM";} if(h >= 13) {hour = h - 12;} document.getElementById('txt').innerHTML=d+"/"+mo+"/...