VBScript DatePart Function
Definition and Usage
The DatePart function can return the specified part of the given date.
Note:firstdayofweek parameter will affect the calculation using the 'w' and 'ww' interval symbols.
Syntax
DatePart(interval,date[,firstdayofweek[,firstweekofyear]])
Parameter | Description |
---|---|
interval |
অপরিহার্য। date1 এবং date2 之间的 সময়সীমা গণনা করতে হবে একটি ইউনিট নিচের মানগুলো গ্রহণযোগ্য:
|
date | অপরিহার্য। যা গণনা করতে হবে একটি তারিখ অপেক্ষা। |
firstdayofweek |
অপশনাল। একই সপ্তাহের দিনকে নির্দিষ্ট করা, অর্থাৎ সপ্তাহের কোন দিনটি। নিচের মানগুলো গ্রহণযোগ্য:
|
firstweekofyear |
অপশনাল। একই বছরের প্রথম সপ্তাহকে নির্দিষ্ট করা। নিচের মানগুলো গ্রহণযোগ্য:
|
উদাহরণ
উদাহরণ 1
d = #2/10/96 16:45:30# document.write(DatePart("yyyy",d)) 'আউটপুট: 1996' document.write(DatePart("m",d)) 'আউটপুট: 2' document.write(DatePart("d",d)) 'আউটপুট: 10' document.write(DatePart("h",d)) 'আউটপুট: 16' document.write(DatePart("n",d)) 'আউটপুট: 45' document.write(DatePart("s",d)) 'আউটপুট: 30' document.write(DatePart("q",d)) 'আউটপুট: 1, 2 মার্চ এটি 1তম ত্রৈমাসিক।' document.write(DatePart("y",d)) 'আউটপুট: 41, 2 মার্চ 10, 1996 এটি 1996তম বছরের 41তমা।' document.write(DatePart("ww",d)) 'আউটপুট: 6, 2 মার্চ 10, 1996 এটি 1996তম সপ্তাহের 6তমা।' document.write(DatePart("w",d)) 'আউটপুট: 7, 2 মার্চ 10, 1996 এটি 6তম সপ্তাহের 7মা (শুক্রবার)।'