Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Found 445 Articles for Programming Scripts

Set the minutes for a specified date according to universal time.

Alankritha Ammu
Updated on 23-Jun-2020 08:07:23

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

How to return a string representing the source for an equivalent Date object?

Daniol Thomas
Updated on 23-Jun-2020 08:07:54

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() );          

How to return the "time" portion of the Date as a string using the current locale's conventions?

Priya Pallavi
Updated on 23-Jun-2020 08:09:03

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

Set the seconds for a specified date according to universal time.

Rama Giri
Updated on 23-Jun-2020 08:08:31

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 );          

How to define a Regular Expression in JavaScript?

Sravani S
Updated on 19-May-2020 11:07:45

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

How to convert a date to a string using the universal time convention?

Nancy Den
Updated on 23-Jun-2020 07:59:39

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() );          

How to return the "time" portion of the Date as a human-readable string.

Sai Nath
Updated on 23-Jun-2020 08:00:07

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() );          

What is the role of ignoring Case RegExp property in JavaScript?

Abhinanda Shri
Updated on 19-May-2020 11:06:36

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

What is the role of source RegExp property in JavaScript?

Akshaya Akki
Updated on 23-Jun-2020 08:02:06

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);          

What is availHeight property in JavaScript?

karthikeya Boyini
Updated on 23-Jun-2020 08:03:15

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);          

Advertisements