
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 445 Articles for Programming Scripts

125 Views
JavaScript date setUTCMinutes() method sets the minutes for a specified date according to universal time.The following are the parameters for setUTCMinutes(minutesValue[, secondsValue[, msValue]]) method −minutesValue − An integer between 0 and 59, representing the minutes.secondsValue − An integer between 0 and 59, representing the seconds. If you specify the secondsValue parameter, you must also specify the minutesValue.msValue − A number between 0 and 999, representing the milliseconds. If you specify the msValue parameter, you must also specify the minutesValue and secondsValue.ExampleYou can try to run the following code to set the minutes for a specified date according to universal time ... Read More

87 Views
To return a string representing the source for an equivalent Date object, use the JavaScript toSource() method. This method returns a string representing the source code of the object.ExampleYou can try to run the following code to return a string representing the source for an equivalent Date object − JavaScript toSource() Method var dt = new Date(2018, 0, 15, 14, 39, 7); document.write( "Formated Date : " + dt.toSource() );

89 Views
To return the "time" portion of the Date as a string, using the current locale's conventions, use the toLocaleTimeString() method.The toLocaleTimeString method relies on the underlying operating system in formatting dates. It converts the date to a string using the formatting convention of the operating system where the script is running. For example, in the United States, the month appears before the date (04/15/98), whereas in Germany, the date appears before the month (15.04.98).ExampleYou can try to run the following code to return the “time” portion of the Date as a string − JavaScript toLocaleTimeString ... Read More

120 Views
JavaScript date setUTCSeconds() method sets the seconds for a specified date according to universal time.The following are the parameters for setUTCSeconds(secondsValue[, msValue]) methodLsecondsValue − An integer between 0 and 59, representing the seconds.msValue − A number between 0 and 999, representing the milliseconds.ExampleYou can try to run the following code to set seconds for a specified date − JavaScript setUTCSeconds Method var dt = new Date( "Aug 28, 2008 13:30:00" ); dt.setUTCSeconds( 65 ); document.write( dt );

136 Views
A regular expression is an object that describes a pattern of characters.The JavaScript RegExp class represents regular expressions, and both String and RegExp define methods that use regular expressions to perform powerful pattern-matching and search-and-replace functions on the text. A regular expression could be defined with the RegExp () constructor, as follows −var pattern = new RegExp(pattern, attributes); or var pattern = /pattern/attributes;The following are the parameters −pattern − A string that specifies the pattern of the regular expression or another regular expression.attributes − An optional string containing any of the "g", "i", and "m" attributes that specify ... Read More

142 Views
To convert a date to a string using the universal time convention, use the toUTCString() method. It returns converted the date to a string, using the universal time convention.ExampleYou can try to run the following code to learn how to convert a date to a string using UTC − JavaScript toUTCString Method var dateobject = new Date(2018, 0, 15, 14, 39, 7); document.write( dateobject.toUTCString() );

80 Views
To return the “time” portion of the Date as a human-readable string, use the toTimeString() method in JavaScript. This method returns the time portion of a Date object in the human-readable form.ExampleYou need to run the following code to return only the time portion of a Date − JavaScript toTimeString Method var dateobject = new Date(2018, 0, 1, 14, 39, 7); document.write( dateobject.toTimeString() );

72 Views
ignoreCase is a read-only boolean property of RegExp objects. It specifies whether a particular regular expression performs case-insensitive matching, i.e., whether it was created with the "i" attribute.ExampleYou can try to run the following code to learn how to work with Ignore Case RegExp property in JavaScript. JavaScript RegExp ignoreCase Property var re = new RegExp( "string" ); if ( re.ignoreCase ) { document.write("Test1-ignoreCase property is set"); } ... Read More

132 Views
The source RegExp property in JavaScript is a read-only string property of RegExp objects. It contains the text of the RegExp pattern. This text does not include the delimiting slashes used in regular-expression literals, and it does not include the "g", "i", and "m" attributes.ExampleYou can try to run the following code to learn how to implement source RegExp property in JavaScript − JavaScript RegExp source Property var str = "JavaScript is an interesting scripting language"; var re = new RegExp( "script", "g" ); re.test(str); document.write("The regular expression is : " + re.source);

71 Views
Use the screen.availHeight property to return the width of the user’s screen. The result will be in pixels and Taskbar feature won’t be included.ExampleYou can try to run the following code to learn how to work with the screen.availHeight property in JavaScript −Live Demo document.write("Height of the screen: "+screen.availHeight);