javascript - date string formatting -


एक स्ट्रिंग लेने का सबसे अच्छा तरीका है जो ... ...

YYYY- एमएम-डीडी

और ऐसा दिखता है ...

एमएम / डीडी / वाई वाई वाई वाई

कारण यह एक जावास्क्रिप्ट तिथि ऑब्जेक्ट नहीं है क्योंकि मैं बड़े पैमाने पर डेटा के साथ काम कर रहा हूं और इन तिथियों को डेटाबेस से खींच लिया जा रहा है।

मुझे इसे डेट ऑब्जेक्ट में बदलने की कोई आवश्यकता नहीं है।

कैसे के बारे में:

  s.sstrstr (5,2) + '/' + S.substr (8) + '/' + s.substr (0,4)  

Comments

Popular posts from this blog

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

php - What is the best way to get the URL of a 404'd file after redirect? -