小编Kev*_*vin的帖子

如何从时间戳检索日月和年(长格式)

我需要从时间戳对象中检索日期和月份作为长数字:

public long getTimeStampDay()
    {

            String iDate = new SimpleDateFormat("dd/MM/yyyy")
        .format(new Date(born_date.getDate())); 
         .....

              return day; //just the day

    }

public long getTimeStampMonth()
    {
    String iDate = new SimpleDateFormat("dd/MM/yyyy")
        .format(new Date(born_date.getDate())); 
         .....

              return month; //just month

    }

public long getTimeStampYear()
    {
    String iDate = new SimpleDateFormat("dd/MM/yyyy")
        .format(new Date(born_date.getDate())); 
         .....

              return year; //just year
    }
Run Code Online (Sandbox Code Playgroud)

born_date 是一个时间戳对象.

有可能吗?

提前致谢.

java datetime

21
推荐指数
2
解决办法
6万
查看次数

JSTL c:选择问题

我需要使用JSTL select语句实现一个switch case,我有树不同的选择.任何人都知道下面的代码不起作用的原因?

提前致谢.

<c:choose>
    <c:when test="${iUserInfo.identification_card_type}==0">
        <option selected="selected">Carta di Identità</option>
        <option>Passaporto</option>
        <option>Patente di Guida</option>
    </c:when>
    <c:when test="${iUserInfo.identification_card_type}==1">
        <option>Carta di Identità</option>
        <option selected="selected">Passaporto</option>
        <option>Patente di Guida</option>
    </c:when>
    <c:when test="${iUserInfo.identification_card_type}==2">
        <option>Carta di Identità</option>
        <option>Passaporto</option>
        <option selected="selected">Patente di Guida</option>
    </c:when>
    <c:otherwise>
        <option>Scegli...</option>
        <option>Carta di Identità</option>
        <option>Passaporto</option>
        <option>Patente di Guida</option>
    </c:otherwise>
</c:choose>
Run Code Online (Sandbox Code Playgroud)

jsp jstl el

1
推荐指数
1
解决办法
5709
查看次数

标签 统计

datetime ×1

el ×1

java ×1

jsp ×1

jstl ×1